# Watcher for absence of data in given time

**URL:** <https://discuss.elastic.co/t/watcher-for-absence-of-data-in-given-time/192019>\
**Category:** Elasticsearch\
**Created:** [July 24, 2019, 12:02pm UTC](https://discuss.elastic.co/t/watcher-for-absence-of-data-in-given-time/192019 "2019-07-24T12:02:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghost3h](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@ghost3h](https://discuss.elastic.co/u/ghost3h)\
**Post date:** [July 24, 2019, 12:02pm UTC](https://discuss.elastic.co/t/watcher-for-absence-of-data-in-given-time/192019/1 "2019-07-24T12:02:28Z")

</div>

I have been trying to write a watcher for when my logstash instances go down. Obviously I cant write one to query a field, but need to write it for the lack of data for a given index for a period of time. I have tried several iterations, but none of these work.

```
    "query": {
        "bool": {
          "must": [
            {
              "query_string": {
                "default_field": "host",
                "query": "*MON011080*"
              }
            },
            {
              "query_string": {
                "default_field": "host",
                "query": "*MON011080*"
              }
            }
          ],
          "filter": {
            "range": {
              "@timestamp": {
                "from": "now-8m",
                "to": "now"
              }
            }
          }
        }
      }

```

Also tried it with exists, but that doesnt seem to work either. Can anyone steer me in the right direction?

---

<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:** [August 21, 2019, 12:02pm UTC](https://discuss.elastic.co/t/watcher-for-absence-of-data-in-given-time/192019/2 "2019-08-21T12:02:29Z")

</div>

Closed on August 21, 2019, 12:02pm UTC

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