Hi, In kibana 8.6, I am trying to create and Alert of type "Query DSL". In the DSL query, I wanted to pick the lastest document, which breached the filesystem used percentage great than 80% for each cloud.instance. Seems like Elasticsearch provides the "collapse" clause, which can be used for grouping and picking the lastest document using sort.
Will the following DSL query work in Kibana's Alert type "Quey DSL"? Meaning.. Will the "collapse" clause work in Kibana's Alert type "Query DSL"?
{
"size": 500,
"query": {
"bool" : {
"must" : {
"range" : {
"system.filesystem.used.pct" : { "gte" : 80 }
}
},
"must_not" : {
"term" : { "system.filesystem.mount_point" : "/boot" }
},
}
},
"collapse": {
"field": "cloud.instance.name",
"inner_hits": {
"name": "latest",
"size": 1,
"sort": [{"@timestamp": {"order": "desc"}}]
}
}
}