I am using watcher for calling webhook and email , it is working perfectly fine .
But i need to apply one more condition and depending on that condition i want to call different email which is different from first one . I want to check if data is coming in metricbeat or not . where to add second condition and it's action ?
Please find below working watcher script
so instead of using a compare condition you can use a script condition. Scripting allows you to check arbitrary things based on whatever logic you have in mind and thus is extremely customizable.
Regarding the recipient: Within your condition you could add an additional snippet, that sets a field like ctx.payload.email_recipient = "foo@bar" - and of course you can set the recipient based on any if condition you like within your script. This would allow you to set "to" : "{{ctx.payload.email_recipient}}" in your email and have a dynamic recipient.
I want to check if data is not coming in metricbeat index . So i want to place condition ctx.payload.hits.total" : { "eq" : 0 } . And when this condition mets then it should call another email saying metricbeat data is not coming .
I want to add this part in working watcher script . How i should add this part ?
Can you please help me to add other condition in same watcher ?
I want to check if data is not coming in metricbeat index . So i want to place condition ctx.payload.hits.total" : { "eq" : 0 } . And when this condition mets then it should call another email saying metricbeat data is not coming .
Working watcher script is given in above messages. Please help me to add other condition in same watcher .
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.