Sending all the aggregations Response in multiple lines

Hi,

I configured the watcher to generate email alert with transactions counts for every 24 hrs.
using aggregations I configured the watcher
"aggs": {
"2": {
"terms": {
"field": "TransactionName.keyword",
"size": 5,
"order": {
"_count": "asc"
}
}
}
}
the response for the watcher is

"aggregations": {
"2": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "SAP start",
"doc_count": 4519
},
{
"key": " Int Req",
"doc_count": 4519
},
{
"key": "SAP Success",
"doc_count": 4517
},
{
"key": "SAP Failure",
"doc_count": 2
}
]
}
}

I tried to execute the following line in my watcher but I was able to get in single line
{{#ctx.payload.aggregations.2.buckets}}{{key}}: {{doc_count}} {{/ctx.payload.aggregations.2.buckets}}

I want to Execute this result in multiple lines in email alert.

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