Create Aggregate filter on kibana

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"
}
}
]
}
}
}
}
}
}

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