Kibana visualise using a JSON key instead of value as the Term

Hi

If I have some JSON data that I've added to Kibana/Elastic and it's automatically created the index, I can easily create visualisations for the final leaf values. E.g. in the data below, I could create a pie chart with Field in a Terms aggregation as "name" or "offers.discount".

However, I can't find a way to draw a pie-chart using the JSON keys that that have child dictionaries under them as the Field? E.g. I want to use "offers" as a Field and have a pie-chart showing 2 * discount, 2 * get_second_type_free.

[{
    “type”: “chocolate”,
    “name”: “Kit Kat”,
    “cost”: 1.23,
    “offers”: {
        “discount”: -0.1
    }
},
{
    “type”: “chocolate”,
    “name”: “Snickers”,
    “cost”: 4.32,
    “offers”: {
        “get_second_type_free”: “cake”
    }
},
{
    “type”: “cake”,
    “name”: “Lemon”,
    “cost”: 1.23,
    “offers”: {
        “discount”: -0.1
        “get_second_type_free”: “fruit”
    }
},
{
    “type”: “fruit”,
    “name”: “apple”,
    “cost”: 0.5,
    “offers”: null
}]

Thanks :slight_smile:

Hmm, I honestly can't think of a great way to do that. Would you mind commenting on this issue with your use case? https://github.com/elastic/kibana/issues/25820

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