Division of sum aggregation by the count of the bucket


(Siddharth Jain) #1

Greetings.
I have term buckets, on which I have a metric which tells the sum of some event for each bucket, say "abstractEvent", I want to calculate the percentage of this abstractEvent metric, ie. I want to calculate the ratio of the value of abstractEvent for a bucket by the size of the bucket.
P.S. I dont want to use timelion or any plugin.


(Brandon Kobel) #2

Hey @siddharth_jain, it sounds like you're looking for the Bucket Script Aggregation which unfortunately isn't supported via the normal Visualizations right now. This GitHub issue tracks that request, so if you could +1 or comment with your usages on that ticket, it'll help us prioritize it appropriately.

Would you mind describing your data and the type of chart that you're looking to create? There's the potential to use the Time Series Visual Builder to create some charts that use the bucket script aggregation, but as the title for the feature alludes to, it's largely centered around time series data.


(Siddharth Jain) #3

Hey @Brandon_Kobel,
I have a metric which takes the value 0 or 1, showing the occurence of an impression. I want to calculate the percentage of such impressions in all requests. As per the requirements, I don't want to visualize the data wrt time.

I have already used the Bucket Script Aggregation to get the desired results via elasticsearch itself. I was looking to do the same for the visualization. Anyways I gave a +1 to the issue, hoping to get an update of the same on kibana.


(system) #4

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