Watcher - include all errors in e-mail

(Ptak) #1

I've created a watch which shows me how many errors have been written in the log file (which is taken by logstash and then transferred to elasticSearch) for a specific range of time. For now in the email body I send the number of errors, which is configured in the watcher like this:

"actions" : {
"send_email" : { 
"email" : { 
"to" : "", 
"subject" : "Watcher Notification", 
"body" : "{{}} exceptions found.  

now I would like to add in the e-mail body the exact exceptions text. How should I do this? I

(Alexander Reelsen) #2

you can loop through the hits like hits



(Ptak) #3

Thanks, it works. Can you please explain how this works? Eventually, how can I include more than one fields? For instance: I want to show the exact error message and also machine on which it occurs

(Alexander Reelsen) #4

I think the easiest way is to check out the mustache docs about lists, as this is what we are doing there

You can basically select anything from inside the payload using the regular dot notation like that you also know from queries.

(system) #5

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