# Watcher range query Problem

**URL:** <https://discuss.elastic.co/t/watcher-range-query-problem/135630>\
**Category:** Elasticsearch\
**Created:** [June 13, 2018, 6:08am UTC](https://discuss.elastic.co/t/watcher-range-query-problem/135630 "2018-06-13T06:08:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oleg.parschalk](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@oleg.parschalk](https://discuss.elastic.co/u/oleg.parschalk)\
**Post date:** [June 13, 2018, 6:08am UTC](https://discuss.elastic.co/t/watcher-range-query-problem/135630/1 "2018-06-13T06:08:50Z")

</div>

Hi Guys,

i have a problem with my watcher. I try to search for 500 nginx access response code error in the last 24h. But no results are found. And this is quite impossible. The Dashboard tells me i have 2000+ hits in the last 24h.

Here is my json text. I must say that i'm a newbie with json and Watcher.

```
{
  "trigger": {
    "schedule": {
      "interval": "10s"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "filebeat*"
        ],
        "types": [],
        "body": {
          "query": {
            "bool": {
              "must": [
                {
                  "match": {
                    "nginx.access.response_code": "500"
                  }
                },
                {
                  "range": {
                    "date": {
                      "gte": "now-1h/d",
                      "lt": "now/d"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  },
  "condition": {
    "always": {}
  },
  "actions": {
    "send_email": {
      "throttle_period_in_millis": 300000,
      "email": {
        "profile": "standard",
        "attachments": {
          "attached_data": {
            "data": {
              "format": "json"
            }
          }
        },
        "priority": "high",
        "to": [
          "EMAILADRESS"
        ],
        "subject": "Encountered {{ctx.payload.hits.total}} Response code 500 errors",
        "body": {
          "text": "Too many error in the system, see attached data"
        }
      }
    }
  },
  "metadata": {
    "color": "red"
  }
}

```

I read all the discussions here and i tried over and over again but with no results.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 22, 2018, 2:13pm UTC](https://discuss.elastic.co/t/watcher-range-query-problem/135630/2 "2018-06-22T14:13:43Z")

</div>

Hey,

please share the output of the [Execute Watch API](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/watcher-api-execute-watch.html) for this watch, so we can take a look what happens!

Thanks!

--Alex

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 20, 2018, 2:24pm UTC](https://discuss.elastic.co/t/watcher-range-query-problem/135630/3 "2018-07-20T14:24:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
