Visualising field values as count metric in Kibana


(vick) #1

Hi All,

I have already imported json results of to my index and I would like to visualise and plot the json results to take the Count from the field "doc_count":3467 and assign that to the respective country field. I had been having difficulty in plotting this data on a pit chart or vertical graph as the count metrics option only takes the number of times the specific field is seen in the logs. My requirement is to plot the count based on the value of the field. I am just stating with elastic search and kibana and any assistance on how this can be achieved is really helpful.

Example index values are below:

{"index": {"_id": 1}}
{"doc_count":3467,"country":"AU"}
{"index": {"_id": 2}}
{"doc_count":345780,"country":"TW"}
{"index": {"_id": 3}}
{"doc_count":99786,"country":"KR"}
{"index": {"_id": 4}}
{"doc_count":2345,"country":"HK"}
{"index": {"_id": 5}}
{"doc_count":56432,"country":"IN"}
{"index": {"_id": 6}}
{"doc_count":9978654,"country":"CN"}


(Felix Stürmer) #2

Hi @ravick,

if I understand you correctly, you can achieve that with the following setup:

  • start a new pie-, line- or bar-chart of the desired type for your index
  • choose the Max aggregation over the field doc_count as the y-axis metric
  • choose the Terms aggregation over the field country as the x-axis buckets
  • adjust the bucket order and size to match your use-case

That could look like this:


(vick) #3

Hi @weltenwort,

That did the trick. Many thanks for your advice.
I am able to plot the graph i was expecting.


(system) #4

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