How to merge two arrays into single array

How can i show values in kibana pie chart from multiple array fields ?

I have document like below:

{
  "field1": ["a", "b", "c"], 
  "field2": ["a", "x", "y", "z"],
}

I want to see the aggregations combining both fields like

{"field3": ["a", "b", "c", "x", "y", "z"]}

If there is no direct way in kibana, can i use painless script to create new field for existing documents ? can someone provide me, to use in update_by_query ?

What you have there is aggregated data by itself. This is not what Kibana's Pie Chart uses. It does requests on non-aggregated data to Elasticsearch which then returns aggregated data to display. For this you could probably look into Canvas as it also has Pie Charts and it can use single documents as a source for it.

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