Watcher email action: How to include search query in email body or attachment


(Eric) #1

I have the following email action

"actions" : {
"watcher_email" : {
"email": {
"account": "outlook_account",
"to": "''",
"subject" : "Watcher Alert: {{}} log entries --- severity: Fatal",
"body" : "Watcher "{{ctx.watch_id}}" Encountered {{}} log entries, see attached data",
"attachments" : {
"incidentData.json" : {
"data" : {
"format" : "json"
"priority" : "high"

Is there a way to also include search query in email body or attachment?

Thank you for your help,

(Alexander Reelsen) #2


you cannot include the search query. however when you only want to include the term that searched for, you could put additional info in the metadata, which is part of the attachment data. You could even reuse that info in your query, by using a search template and referring to the metadata in the params.


(Eric) #3

That's great. Thank you for your help.

Is there a way to insert a new line "\n" in the email "body" element?

(system) #4