# Watcher query

**URL:** <https://discuss.elastic.co/t/watcher-query/183123>\
**Category:** Kibana\
**Created:** [May 28, 2019, 2:23pm UTC](https://discuss.elastic.co/t/watcher-query/183123 "2019-05-28T14:23:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yasin](https://avatars.discourse-cdn.com/v4/letter/y/9e8a1a/32.png) [@yasin](https://discuss.elastic.co/u/yasin)\
**Post date:** [May 28, 2019, 2:23pm UTC](https://discuss.elastic.co/t/watcher-query/183123/1 "2019-05-28T14:23:56Z")

</div>

Dear Team,

After searching for the monitor.status: down we wanted to add an extra output to slack to know for which host we have received it. Is that possible?

```
{
  "trigger": {
    "schedule": {
      "interval": "1m"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "heartbeat-*"
        ],
        "types": [],
        "body": {
          "size": 5,
          "query": {
            "match": {
              "monitor.status": "down"
            }
          }
        }
      }
    }
  },
  "condition": {
    "compare": {
      "ctx.payload.hits.total": {
        "gt": 5
      }
    }
  },
  "actions": {
    "notify-slack": {
      "slack": {
        "account": "monitor",
        "message": {
          "from": "watcher",
          "to": [
            "elk"
          ],
          "text": "Core-Service Down:",
          "attachments": [
            {
              "color": "danger",
              "title": "Core-Service Down for customer:",
              "text": ""
            }
          ]
        }
      }
    }
  }
}

```

 ![slack](https://us1.discourse-cdn.com/elastic/original/3X/5/e/5ebf4aee15b0dddc5897c22a1fdda4c0b237a189.png)

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [May 28, 2019, 5:28pm UTC](https://discuss.elastic.co/t/watcher-query/183123/2 "2019-05-28T17:28:04Z")

</div>

Hey @yasin,

The docs for slack actions give examples on how to inject data from your watcher input into the action itself. Check the bottom of this page: [https://www.elastic.co/guide/en/elastic-stack-overview/7.1/actions-slack.html](https://www.elastic.co/guide/en/elastic-stack-overview/7.1/actions-slack.html)

---

<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:** [June 25, 2019, 5:28pm UTC](https://discuss.elastic.co/t/watcher-query/183123/3 "2019-06-25T17:28:05Z")

</div>

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