Terms Aggregating over array elements and correlating data from a second array

Hi,
I have data in the following form:

doc1: {"names": ["n1","n2","n3"], "data_points":[0,1,2]}
doc2: {"names": ["n1","n2","n3"], "data_points":[1,2,3]}
doc3: {"names": ["n1","n2","n3"], "data_points":[2,3,4]}

Which corresponds to the series n1:0-1-2, n2:1-2-3 and n3:2-3-4. They are basically completely separate functions. I want to plot the data_points over time, one plot for each name, but all in a single visualization. How can I achieve this in a Kibana visualization? If the datapoints would be one per doc like so: {"name": "n1", "data_point":0}, I know I could just use the Terms aggregation, but that doesn't seem to work in this case. After some search, I discovered that maybe the composite aggregation might help me in this case, but it doesn't seem to be available in Kibana(?).

I can not restructure the data to have one datapoint per doc, but I could restructure it like this, if that helps:

 doc1: {"touples": [{"name": "n1", "data_point":0},{"name": "n2", "data_point":1},{"name": "n3", "data_point":2}]}

Hi @svbernem,

After some search, I discovered that maybe the composite aggregation might help me in this case, but it doesn't seem to be available in Kibana

I am not an expert on this matter, but I think you could try to use Vega visualisation for composite aggregation.

Some details on Vega:

Hope this is helpful

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