Kibana - Average based on two fields value

Hello all,

I'm using Kibana 6.8.2, and I have an index with next parameters

* message_total_size
* message_total_count
* date
* country

I want to make a Vertical Bar visualization to show the average message size per day (using date histogram), but I cannot find a way to make the division like: message_total_size/message_total_count

I tried with the Average aggregation, but it doesn't work form in this case (at least I cannot see how), because is making the average based on the number of documents in the index.

I'd appreciate any help, thanks :slight_smile:

Regards,
JL

you can use Time Series Visual Builder for this. I loaded in a 6.8.2 new instance the flights sample data and created a chart that renders a ratio between the average distance and the average flight time using the Bucket Script aggregation

This blog post also covers pretty well the topic of computing ratios in different Kibana applications.

1 Like

Hello jsanz,

Thanks a lot for your help! Do you know if you can change the X and Y Axis title, like with Bar Visualizations?

I don't think you can do that, my best effort following my last example was to improve units in the y axis and a better layer name that appears in the legend

As always, feel free to open a feature request in our issue tracker, since I haven't found anything like this.

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