I am using Watcher/Alerts to send some emails but it dont seem to find out how to get all keys from an array with out all the array:
{{ctx.payload.aggregations.host.buckets.*.key}}
<-- this is what my logic said it should work but it didnt ![]()
"host" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"doc_count" : 3,
"key" : "someservername-02.com"
},
{
"doc_count" : 3,
"key" : "someservername-03.com"
}
]
},
I have to specify each but i am not sure how to find out how many to iterate but i ithink iterations are not possible here so is there a way just to print the keys? i want to avoid the doc_count?
i know this works
{{ctx.payload.aggregations.host.buckets}}
but can i just filter a specific field?
I tried adding a bunch of
{{ctx.payload.aggregations.host.buckets.1.key}} {{ctx.payload.aggregations.host.buckets.2.key}} {{ctx.payload.aggregations.host.buckets.3.key}}
but ill get an out of index array because there isnt 3 every time.
