# Alerting on a specific time range

**URL:** <https://discuss.elastic.co/t/alerting-on-a-specific-time-range/266999>\
**Category:** Kibana\
**Tags:** elastic-stack-machine-learning, elastic-stack-alerting\
**Created:** [March 11, 2021, 8:51pm UTC](https://discuss.elastic.co/t/alerting-on-a-specific-time-range/266999 "2021-03-11T20:51:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [March 12, 2021, 1:52pm UTC](https://discuss.elastic.co/t/alerting-on-a-specific-time-range/266999/5 "2021-03-12T13:52:19Z")

</div>

It would be some logic using `range` in the query or a dynamic script. See ideas here: [How to filter date field by days and hours separately](https://discuss.elastic.co/t/how-to-filter-date-field-by-days-and-hours-separately/193946)

You could also consider using runtime fields ([Retrieve a runtime field | Elasticsearch Reference [7.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime-retrieving-fields.html)) to define day of the week or hour of day (or both) and then filter your query on that

---

_[View the full topic](https://discuss.elastic.co/t/alerting-on-a-specific-time-range/266999)._
