I have this type of json data :
{
“@timestamp”: “2020-01-19T15:29:50+02:00”,
"Boards": [{
"Name": "Agile_Board_1",
"id": 123,
"Sprints": [{
"SprintName": "Sprint_1",
"State": "Active",
"Issues": [{
"Key": "JIRA-1856",
"Assignee": "Sam",
"Status": "Open",
"Type": "Story",
"StoryPoint": 5
},
{
"Key": "JIRA-2356",
"Assignee": "Shubham",
"Status": "Closed",
"Type": "Fix",
"StoryPoint": 8
},
{
"Key": "JIRA-2656",
"Assignee": "Lucky",
"Status": "In Progress",
"Type": "Defect",
"StoryPoint": 8
}
]
},
{
"SprintName": "Sprint_2",
"State": "Closed",
"Issues": [{
"Key": "JIRA-1859",
"Assignee": "KARAN",
"Status": "Open",
"Type": "Story",
"StoryPoint": 5
},
{
"Key": "JIRA-1858",
"Assignee": "Shubham",
"Status": "Closed",
"Type": "Fix",
"StoryPoint": 8
},
{
"Key": "JIRA-1859",
"Assignee": "Lucky",
"Status": "In Progress",
"Type": "Defect",
"StoryPoint": 8
}
]
}
]
}]
}
I want to apply lucene query to filter out the data with “Boards.Sprints.Issues.Status”: “Open”,
As to filter out the data i want to use nested aggregation with filtered sub aggregation which contains top_hits
sub aggregation. The query looks like:
{
“size”: 0,
“aggs”: {
“nested”: {
“nested”: {
“path”: “Boards.Sprints.Issues”
},
“aggs”: {
“filter”: {
“filter”: {
“match”: { “Boards.Sprints.Issues.Status”: “Open” }
},
“aggs”: {
“t”: {
“top_hits”: {
“size”: 100
}
}
}
}
}
}
}
}
So how to use this king aggregated nested query in grafana?