# Create advance watcher

**URL:** <https://discuss.elastic.co/t/create-advance-watcher/210347>\
**Category:** Elasticsearch\
**Created:** [December 3, 2019, 1:17pm UTC](https://discuss.elastic.co/t/create-advance-watcher/210347 "2019-12-03T13:17:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivudu](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@shivudu](https://discuss.elastic.co/u/shivudu)\
**Post date:** [December 3, 2019, 1:17pm UTC](https://discuss.elastic.co/t/create-advance-watcher/210347/1 "2019-12-03T13:17:17Z")

</div>

Hi Team,

I enable email alert in Elasticsearch after that it is enabled in kibana also.  
[In kibana dashboard \>management\>watcher] I created one sample watcher by clicking on "create watcher" and I executed manually , its working fine and mails all got but when I am going to create sample watcher in" advance watcher" with particular time interval like below and its executing as I expected according to time intervals but not getting mails.

{  
"trigger": {  
"schedule": {  
"cron": "0 0/1 \* \* \* ?"  
}  
},  
"input": {  
"search": {  
"request": {  
"search\_type": "query\_then\_fetch",  
"indices": [  
"logstash\*"  
],  
"types": ,  
"body": {  
"query": {  
"bool": {  
"must": {  
"match": {  
"response": 404  
}  
},  
"filter": {  
"range": {  
"@timestamp": {  
"from": "{{ctx.trigger.scheduled\_time}}||-5m",  
"to": "{{ctx.trigger.triggered\_time}}"  
}  
}  
}  
}  
}  
}  
}  
}  
},  
"condition": {  
"compare": {  
"ctx.payload.hits.total": {  
"gt": 0  
}  
}  
},  
"actions": {  
"email\_admin": {  
"email": {  
"profile": "standard",  
"to": [  
"[test@gmail.com](mailto:test@gmail.com)"  
],  
"subject": "404 recently encountered"  
}  
}  
}  
}

Could you please give your valuable suggestions for this.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [December 12, 2019, 11:47pm UTC](https://discuss.elastic.co/t/create-advance-watcher/210347/2 "2019-12-12T23:47:06Z")

</div>

Hey ,  
I'm going to move this question to the Elasticsearch topic because we have to use the "advanced watch" functionality in Kibana which essentially allows you to create a watch definition directly using the Elasticsearch APIs.  
Logs would help here.

Thanks  
Rashmi

---

<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:** [January 9, 2020, 11:47pm UTC](https://discuss.elastic.co/t/create-advance-watcher/210347/3 "2020-01-09T23:47:15Z")

</div>

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