Last active
September 11, 2016 11:16
-
-
Save keyboardAnt/9dbf094123c818cd68bd986b52af9dd5 to your computer and use it in GitHub Desktop.
ES watch: core dumps query
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
PUT _watcher/watch/core_dumps_slack | |
{ | |
"trigger" : { | |
"schedule" : {"interval" : "1m"} | |
}, | |
"input" : { | |
"search" : { | |
"request" : { | |
"body" : { | |
"query": { | |
"bool": { | |
"must": [ | |
{"exists": {"field": "session.core_dumps"}}, | |
{"range": {"_timestamp": {"from": "now-1m"}}} | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
"condition" : { | |
"compare" : { | |
"ctx.payload.hits.total": {"gt": 0} | |
} | |
}, | |
"actions" : { | |
"notify-slack" : { | |
"throttle_period" : "1m", | |
"slack" : { | |
"message" : { | |
"to" : [ "#new-core-dumps" ], | |
"text" : "Found {{ctx.payload.hits.total}} new core dumps: {{ctx.payload.hits.hits}}" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment