I've been having some trouble recreating an aggregation in kibana. I have the following elasticsearch agg I would like to recreate but I can't figure out how to make sub buckets and take the max from them in kibana (v6):
{
"query": {
"range": {
"time_stamp": {
"lt": "now",
"gte": "now-1d"
}
}
},
"aggs": {
"events_by_host": {
"terms": {
"field": "cell_host_the_app"
},
"aggs": {
"events_by_date": {
"date_histogram": {
"field": "time_stamp",
"interval": "30m"
},
"aggs": {
"total_cpu": {
"sum": {
"field": "cpu_usage
}
},
"max_cpu": {
"max": {
"field": "cpu_usage"
}
}
}
},
"max_aggregated_cpu": {
"max_bucket": {
"buckets_path": "events_by_date>total_cpu"
}
}
}
}
}
}