I have a DSL query that I wrote in Dev Console and I'm trying to use it in Kibana to filter down results to show in a pie chart. However, when I add the following script as a filter in Kibana, it removes the collapse
portion of the query which is the most important part. What am I doing wrong? How do I get this complex collapse
logic into a Kibana graph?
I am running Kibana in Elastic Cloud (v8.6.2).
{
"query": {
"bool": {
"must": [
{
"match": {
"message": "Survey response"
}
},
{
"exists": {
"field": "labels.userId"
}
}
]
}
},
"collapse": {
"field": "labels.userId.keyword",
"inner_hits": {
"name": "labels.passed",
"size": 1,
"sort": [
{
"@timestamp": "desc"
}
]
}
}
}