Created
July 15, 2019 18:08
-
-
Save justinkambic/f0d81ae2941390b4b4eb3bb99382352a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET heartbeat-7*/_search | |
{ | |
"query": { | |
"bool": { | |
"filter": [ | |
{ | |
"exists": { | |
"field": "summary.up" | |
} | |
} | |
] | |
} | |
}, | |
"sort": [ | |
{ | |
"@timestamp": "desc" | |
} | |
], | |
"size": 0, | |
"aggs": { | |
"monitors": { | |
"composite": { | |
"size": 1000, | |
"sources": [ | |
{ | |
"monitor_id": { | |
"terms": { | |
"field": "monitor.id" | |
} | |
} | |
} | |
] | |
}, | |
"aggs": { | |
"top": { | |
"top_hits": { | |
"sort": [ | |
{ | |
"@timestamp": "desc" | |
} | |
], | |
"_source": { | |
"includes": [ | |
"monitor.check_group", | |
"@timestamp", | |
"agent.id" | |
] | |
}, | |
"size": 10 | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment