I'm fairly new to elasticsearch (v2.4.6), but I'm building some basic visualizations on Kibana (v4.6.4) using some existing indices that log cpu usage data. I can run the following aggregation and get the results via a curl command
curl -X GET -u a {https://xyz....2/index1/_search?pretty=true} -d '{
"size": 0,
"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_usgae_percentage"
}
},
"max_cpu": {
"max": {
"field": "cpu_usgae_percentage"
}
}
}
},
"max_aggregated_cpu": {
"max_bucket": {
"buckets_path": "events_by_date>total_cpu"
}
}
}
}
}
}' -k
However, I can not figure out how to post this aggregation to elasticsearch so I can use the results from this aggregation in a visualization.