Add average value of data in existing chart elasticsearch kibana

I have a project in Kibana integrated with elastic search. In Kibana page I am displaying a chart with X(months) and Y(Euro) values.

I want to show a line in the chart that will show the average Euro value of all data.

For the moment I add a manual value to show the horizontal line in the chart. Capture

I want to get average value automatically from my data in elastic search. Is there any option to do this task?

Thank you

Timelion will let you do this because it supports pulling data from multiple sources. Define two series in the timelion expression panel like this: .es(index=newdata*, metric=avg:euro).color(purple), .es(index=alldata*, metric=avg:euro).color(green). You'll want to update the index= parameter to match how your data is stored in elasticsearch and checkout the inline documentation for information about other parameters. Then you can use the interval picker by the play button to switch to 1m. Timelion visualizations can be saved and used on a dashboard like other visualizations.

Thank you for your answer but to be clear,

What i want is: when the dataset is loaded to Elasticsearch i want it to calculate automatically the average of the field Euro and save it to a new field. So even when i change the data or add new ones to the Euro field, the avg(Euro) i want it to be automatic function and i can work with this new average in visualization.
Having automatic calculated average saved in a field must be easier to work with visualization. I think this is the best way to work with it but don't know how to do it.

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