2

I have my data in Elasticsearch like below
enter image description here
I'm trying to create a pie chart in kibana which shows the percentage of people who visited both UK and India and % of people who visited only India and % percentage of people who visited only UK.
But I'm not able to find a way to group by person name and do filter on the country visited in the pie chart in kibana. Any way to do this?

Manoj kumar
  • 227
  • 6
  • 19

1 Answers1

0

I believe you are looking for filterAggregation : Filter Aggregation Effectively it enables aggregation on different filters.

Add this as a second aggregation(split slice) after the Persons Aggregation.

enter image description here

If you are just interested in count and Not counts per person, just leverage Filter Aggregation with respective filters which will give you the percentages per filter.

Rambler
  • 4,994
  • 2
  • 20
  • 27
  • In filter aggregation I'm only able to filter based on single record.. if u see the sample data, they are separate records which needs to be grouped by name to get the list of countries the person visited.. that grouping option seems not available in the filter aggregation. And also i need the % of people in the chart – Manoj kumar Feb 10 '22 at 10:02