Hello,
I have this visualization below to get the 95th percentile per hour:
{
"size": 0,
"_source": {
"excludes": []
},
"aggs": {
"2": {
"date_histogram": {
"field": "AuthorizationUTCTimestamp",
"interval": "1h",
"time_zone": "Asia/Shanghai",
"min_doc_count": 1
},
"aggs": {
"1": {
"percentiles": {
"field": "TokenRequest",
"percents": [
95
],
"keyed": false
}
}
}
}
},
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
"AuthorizationUTCTimestamp",
"IssuedUTCTimestamp",
"signinDateTime"
],
"query": {
"bool": {
"must": [
{
"match_all": {}
},
{
"range": {
"AuthorizationUTCTimestamp": {
"gte": 1544284800000,
"lte": 1544371199999,
"format": "epoch_millis"
}
}
}
],
"filter": [],
"should": [],
"must_not": []
}
}
}
Now, what I would like to achieve is to get the max result of 95th percentile per day based in the result from above request.
Is there anyway I can get the top hit from the aggregations result?
Thanks!