Last active
July 31, 2017 12:31
-
-
Save cmarat/e6aabb995de70e4c3b03aa4d672618ce to your computer and use it in GitHub Desktop.
Query Elasticsearch .monitoring indices for periods of time when the cluster status was red
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 .monitoring-es*/cluster_state/_search | |
{ | |
"size": 0, | |
"query": { | |
"bool": { | |
"filter": [ | |
{ | |
"term": { | |
"cluster_state.status": "red" | |
} | |
}, | |
{ | |
"range": { | |
"timestamp": { | |
"gte": "2017-07-29T00:00:00.000Z" | |
} | |
} | |
} | |
] | |
} | |
}, | |
"aggs": { | |
"red": { | |
"date_histogram": { | |
"field": "timestamp", | |
"interval": "day", | |
"min_doc_count": 1 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment