# How to create watcher email alert on a specific machine in lan?

**URL:** https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [September 29, 2018, 11:04am UTC](https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425 "2018-09-29T11:04:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Aftab\_Ali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aftab_ali/32/35399_2.png) [@Aftab\_Ali](https://discuss.elastic.co/u/Aftab_Ali)
#### Post date: [September 29, 2018, 11:04am UTC](https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425/1 "2018-09-29T11:04:47Z")

</div>

Dear Team,

I am happy to use watcher feature in kibana but I want to create an alert on a specific machine in my local network, I am able to get threshold email via SMTP [gmail.com](http://gmail.com) but I am not able to see a report of which machine had high utilization like CPU usage and memory usage, Please guide me how to do that.

Best Regards  
Aftab Ali  
E-mail - [aftab70@ymail.com](mailto:aftab70@ymail.com)

---

<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: [September 29, 2018, 9:14pm UTC](https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425/2 "2018-09-29T21:14:21Z")

</div>

There are some Watch examples in our "examples" GitHub repo. For example:

> **[elastic/examples](https://github.com/elastic/examples/tree/master/Alerting/Sample%20Watches/cpu_iowait_hosts)**
>
> Home for Elasticsearch examples available to everyone. It's a great way to get started. - elastic/examples

---

<div class="post-metadata">

### Author: ![Aftab\_Ali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aftab_ali/32/35399_2.png) [@Aftab\_Ali](https://discuss.elastic.co/u/Aftab_Ali)
#### Post date: [October 1, 2018, 5:24am UTC](https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425/3 "2018-10-01T05:24:57Z")

</div>

Dear Richcollier,

Thanks for the reply, I want to select host name when creating a watcher alert, I do not want to apply watcher in all machine in the network, please guide me, i am new with elk.

---

<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: [October 1, 2018, 1:06pm UTC](https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425/4 "2018-10-01T13:06:21Z")

</div>

Ah, understood. In that case, in the body of the search clause of Watcher's input section, just use the filter capability of elasticsearch's [query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) to select anything that you want. For example, to only consider data from a machine\_name=webserver1:

```auto
...
                    "query": {
                      "bool": {
                        "filter": [
                          { "range": { "timestamp": {"gte": "now-10m"}}},
                          { "term": { "machine_name": "webserver1"}}
                        ]
                      }
                    }
...

```

---

<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: [October 29, 2018, 1:06pm UTC](https://discuss.elastic.co/t/how-to-create-watcher-email-alert-on-a-specific-machine-in-lan/150425/5 "2018-10-29T13:06:31Z")

</div>

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