Kibana Average metric taking unique count of another field


(parma@cisco.com) #1

I need to calculate the average value of a field. But the base is not the number of documents. I need to consider the unique count of another field as base(denominator). Is there any way to achieve this through built-in visualization or through giving calculated script to kibana


(Bhavya R M) #2

Hi,

You can use scripted field under index patterns to calculate that value and then use it as a base.
Here are the docs which explain how to do it:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-script-fields.html
https://www.elastic.co/guide/en/kibana/current/scripted-fields.html

This is a pretty good blogpost which explains all about it:

Thanks,
Bhavya


(system) #3

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