Complex search query help - Kindly!

HI All

putting together elasticsearch / heartbeat with a angtular dashboard as a frontend.

I would like to return all monitors with the monitor name , last status ( monitor.status ) and percent uptime over the last day and last week. Is this possible with a single search query ?

Here is one of the heartbeats documents json

{
"_index": "heartbeat-6.1.1-2019.03.26",
"_type": "doc",
"_id": "_GyIt2kB12bQLuf-ay84",
"_version": 1,
"_score": null,
"_source": {
"@timestamp": "2019-03-26T01:06:03.723Z",
"http": {
"rtt": {
"response_header": {
"us": 1962
},
"validate": {
"us": 2034
},
"content": {
"us": 71
},
"total": {
"us": 2429
},
"write_request": {
"us": 87
}
},
"url": "http://elasticsearch:9200",
"response": {
"status": 200
}
},
"monitor": {
"type": "http",
"duration": {
"us": 3309
},
"id": "http@http://elasticsearch:9200",
"scheme": "http",
"name": "http",
"host": "elasticsearch",
"ip": "172.19.0.4",
"status": "up"
},
"resolve": {
"host": "elasticsearch",
"ip": "172.19.0.4",
"rtt": {
"us": 787
}
},
"type": "monitor",
"beat": {
"name": "heartbeat",
"hostname": "heartbeat",
"version": "6.1.1"
},
"tcp": {
"rtt": {
"connect": {
"us": 332
}
},
"port": 9200
}
},
"fields": {
"@timestamp": [
"2019-03-26T01:06:03.723Z"
]
},
"sort": [
1553562363723
]
}

Thanks

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