Skip to content

Instantly share code, notes, and snippets.

@lcostantini
Created March 17, 2016 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcostantini/6d531fa611daa2b2830d to your computer and use it in GitHub Desktop.
Save lcostantini/6d531fa611daa2b2830d to your computer and use it in GitHub Desktop.
Watcher configuration to detect one or more slow requests.
{
"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