How to correctly use json fields?


I have an index like that :


I have an ID which could have a list of detail contact.
In my vizualisation, I try to display the number of contacts per channel.

2020-08-13_08h57_45 2020-08-13_08h58_00

The result is 2 SMS and 2 EMAIL whereas i was expecting 1 SMS and 1 EMAIL.

Moreover, I don't understand in the discover, why the field details_contact.jour_contact is extracted from the json document and not the other fields.

Any idea ?

The problem is Kibana aggregations don't support nested arrays like this. For Kibana all of those fields are flattened like this:

  "details_contacts.canal_contact": ["EMAIL", "SMS"],
  "details_contacts.nb_contacts": [1, 1]

This means the association between nb_contacts and canal_contact is lost. If you want to visualize your data with Kibana, you should split up your documents to just have a single details_contacts per document - then the aggregation will work as expected.

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