# Using watcher with ES

**URL:** https://discuss.elastic.co/t/using-watcher-with-es/50032
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [May 13, 2016, 8:33pm UTC](https://discuss.elastic.co/t/using-watcher-with-es/50032 "2016-05-13T20:33:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jemli\_Fathi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jemli_fathi/32/10714_2.png) [@Jemli\_Fathi](https://discuss.elastic.co/u/Jemli_Fathi)
#### Post date: [May 13, 2016, 8:33pm UTC](https://discuss.elastic.co/t/using-watcher-with-es/50032/1 "2016-05-13T20:33:50Z")

</div>

I'm trying to use watcher with ES 1.7.1 to send email alerts every 10s.  
I installed Watcher plugin, configured ES to allow sending emails and created my watch (i think) successfully, but I didn't receive any emails:

- ES configuration in elasticsearch.yml for email activation:

> ```
> #watcher configuration
> watcher.actions.email.service.account:
> gmail:
> profile: gmail
> smtp:
> auth: true
> starttls.enable: true
> host: smtp.gmail.com
> port: 587
> user: ************ @gmail.com
> password: **************
> 
> ```

- My watch

> ```
> PUT http://localhost:9200/_watcher/watch/event_fake_token
> {
> "trigger": {
> "schedule": {
> "interval": "10s"
> }
> },
> "input": {
> "search": {
> "request": {
> "indices": [
> "fouras_logs-*"
> ],
> "body": {
> "query": {
> "match": {
> "message": "fake token"
> }
> }
> }
> }
> }
> },
> "condition": {
> "compare": {
> "ctx.payload.hits.total": {
> "gt": 0
> }
> }
> },
> "actions": {
> "email_admin": {
> "email": {
> "to": "'Jemli Fathi < jemlifathi2013@gmail.com@gmail.com >'",
> "subject": "{{ctx.watch_id}} executed",
> "body": "{{ctx.watch_id}} executed with {{ctx.payload.hits.total}} hits"
> }
> }
> }
> }
> 
> ```

---

<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: [May 25, 2016, 7:30am UTC](https://discuss.elastic.co/t/using-watcher-with-es/50032/2 "2016-05-25T07:30:34Z")

</div>

Hey,

can you either check the logs on your master node and the watch history if any of those contains more information of what failed?

--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 6, 2017, 1:45pm UTC](https://discuss.elastic.co/t/using-watcher-with-es/50032/3 "2017-07-06T13:45:25Z")

</div>


