# How to set a time range in the watcher?

**URL:** <https://discuss.elastic.co/t/how-to-set-a-time-range-in-the-watcher/93679>\
**Category:** Elasticsearch\
**Created:** [July 19, 2017, 2:53am UTC](https://discuss.elastic.co/t/how-to-set-a-time-range-in-the-watcher/93679 "2017-07-19T02:53:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [July 24, 2017, 1:44pm UTC](https://discuss.elastic.co/t/how-to-set-a-time-range-in-the-watcher/93679/6 "2017-07-24T13:44:09Z")

</div>

Hi,

If you haven't changed your query clause to what I recommend, you will get this error because there is a syntax problem in your query clause. You are not properly making an array of clauses in the `filter` section. You have to look close at the matching {} brackets to see.

Please modify it to the following and you'll be fine:

```auto
          "query": {
            "bool": {
              "filter": [
                {
                  "range": {
                    "timestamp": {
                      "gte": "now-3m"
                    }
                  }
                },
                {
                  "match": {
                    "message": "404"
                  }
                }
              ]
            }
          }

```

---

_[View the full topic](https://discuss.elastic.co/t/how-to-set-a-time-range-in-the-watcher/93679)._
