# Help needed with watcher and email notify (failed to execute watch input)

**URL:** https://discuss.elastic.co/t/help-needed-with-watcher-and-email-notify-failed-to-execute-watch-input/79493
**Category:** Elasticsearch
**Created:** [March 21, 2017, 7:09pm UTC](https://discuss.elastic.co/t/help-needed-with-watcher-and-email-notify-failed-to-execute-watch-input/79493 "2017-03-21T19:09:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![marcjonkers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcjonkers/32/16570_2.png) [@marcjonkers](https://discuss.elastic.co/u/marcjonkers)
#### Post date: [March 21, 2017, 7:09pm UTC](https://discuss.elastic.co/t/help-needed-with-watcher-and-email-notify-failed-to-execute-watch-input/79493/1 "2017-03-21T19:09:07Z")

</div>

Hi, I tried this watcher but it does not run. What am I doing wrong? A'm using 5.2.2 version.

{  
"trigger" : {  
"schedule" : {  
"interval" : "1m" }  
},  
"input" : {  
"search" : {  
"request" : {  
"indices" : ["\<logstash-{now/d}\>"],  
"body" : {  
"query" : {  
"match" : { "message": "BGP" }  
},  
"filter": {  
"bool": {  
"must": [  
{  
"range": {  
"@timestamp": {  
"gte": "now-5m"  
}  
}  
}  
]  
}  
}  
}  
}  
}  
},  
"condition" : {  
"compare" : { "ctx.payload.hits.total" : { "gt" : 0 }}  
},  
"actions" : {  
"send\_email" : {  
"throttle\_period" : "15m",  
"email" : {  
"account" : "work",  
"to" : "xxx@xxxxx.xxx",  
"subject" : "[KIBANA] {{ctx.payload.hits.total}} BGP flaps",  
"body" : "BGP flaps detected",  
"attach\_data" : true  
}  
}  
}  
}

---

<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: [April 18, 2017, 7:09pm UTC](https://discuss.elastic.co/t/help-needed-with-watcher-and-email-notify-failed-to-execute-watch-input/79493/2 "2017-04-18T19:09:27Z")

</div>

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