Created
March 17, 2016 15:04
-
-
Save lcostantini/6d531fa611daa2b2830d to your computer and use it in GitHub Desktop.
Watcher configuration to detect one or more slow requests.
This file contains hidden or 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
{ | |
"trigger": { | |
"schedule": { | |
"interval": "20s" | |
} | |
}, | |
"input": { | |
"search": { | |
"request": { | |
"indices": ["logstash-*"], | |
"body": { | |
"query": { | |
"filtered": { | |
"query": { | |
"query_string": { | |
"query": "slow_requests", | |
"analyze_wildcard": true | |
} | |
}, | |
"filter": { | |
"bool": { | |
"must": [{ | |
"range": { | |
"@timestamp": { | |
"gte": "now-20s" | |
} | |
} | |
}], | |
"must_not": [] | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"condition": { | |
"compare": { | |
"ctx.payload.hits.total": { "gte": 1 } | |
} | |
}, | |
"actions": { | |
"send_email": { | |
"email": { | |
"to": "your@email.com", | |
"subject": "Multiple slow requests", | |
"body": "The /healt-check endpoint is responding to slow." | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment