How to Filter the results and show certain array from the list

Hi,

I am leveraging Elasticsearch logs to retrieve the critical Metrics and showing in BI tool. I am currently facing a challenge in Elasticsearch query:

The json document that I am retrieving have multiple segments in a list. I am able to write a query to match specific segment and filter the right document. However, in the resultset I want to get only specific arrays from the list.

So from the "List_Array", I want to get the segmentId in GE or IEA4 to show in the resukt. Is this possible?
"List_Array":
[
{
"element_raw_1": "1213",
"element_raw_0": "11",
"segmentId": "SE",
"segmentIndex": 12,
"element_1": "1213",
"element_0": "11"
},
{
"element_raw_1": "1213",
"element_raw_0": "1",
"segmentId": "GE",
"segmentIndex": 13,
"element_1": "1213",
"element_0": "1"
},
{
"element_raw_1": "000001217",
"element_raw_0": "1",
"segmentId": "IEA",
"segmentIndex": 14,
"element_1": "000001217",
"element_0": "1"
}
]

check out the inner_hits feature of the nested datatype.

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