Search code examples
elasticsearchkibanakibana-4

Kibana, grouping values of same field in bar chart


I am currently exploring Kibana and one of the issues I am running into is that I am not able to group together values of the same field to create a bar chart.

Example - Field's name is Country it has 6 unique values

Canada, US, Uk, Germany, India, China.

Now I want to create a bar chart having 3 bars with x-axis having North America(canada and US), Asia( India and China) ...and so on.

I explored filter and sub-buckets but they don't seem to provide grouping of values instead filtering based on the field.

Thanks,


Solution

  • It is possible to implement what you require. Please follow the following steps:-

    Click on Visualize Tab & Select Vertical Bar Chart (as per your requirement)

    Click on Start from a new Search

    In Y-Axis select as Count.

    Then select X-Axis

    Select Aggregations as Filters.

    In Filter 1 mention:- Country:(Canada OR US)

    In Filter 2 mention:- Country:(India OR China)

    In Filter 3 mention:- Country:(Uk OR Germany)

    where Country is your field name followed by values.

    Click on Apply to see the 3 Bar Chart as you required :)