Calculate average in Kibana visualizations

Hi,

what you are looking for is the bucket script aggregation, which allows you to calculate the outcome of several metric aggregations. This is not yet completely implemented in Kibana, see also https://github.com/elastic/kibana/issues/4707

Nevertheless you could actually achieve that (using Bucket Script aka Calculation) in Visual Builder, where you would just create two sum aggregations (for times and time_sum) and then create a script, that will divide those two and draw this one.

The same could also be achieved in the more stable timelion visualization, by using a script that looks something like:

.es(metric=sum:times).divide(.es(metric=sum:time_sum))

And switching the interval selector to using 5m.

Cheers,
Tim