Computing aggregation bucket size in actions

alerting

(rastro) #1

I'm trying to get the number of buckets in my aggregation.

I tried {{ ctx.payload.aggregations.myAgg.buckets.size() }}, but nothing was displayed. I've seen other posts using that method in conditions, but I need it in actions.

I would also like to get the sum of each bucket's doc_count (different than {{ ctx.payload.hits.total }} when using min_doc_count).


(Alexander Reelsen) #2

Hey,

mustache requires you to use {{ ctx.payload.aggregations.myAgg.buckets.size}} as there is no support for calling functions...

--Alex


(rastro) #3

That worked; thanks.


(system) #4