I'm taking data samples every 12 hours across 80 sites. I'm trying to setup a filter for a given site based on the recent collection_timestamp; I've setup the query as below but how to apply this filter in the kibana filter ?
GET /xyz/_search?
{
"aggs": {
"group": {
"terms": {
"field": "siteName.keyword"
},
"aggs": {
"group_docs": {
"top_hits": {
"size": 1,
"sort": [
{
"collection_timestamp": {
"order": "desc"
}
}
]
}
}
}
}
}
}