Created
March 21, 2019 20:38
-
-
Save rpendela/700d4fa45f5d497fa512ba904d9721e1 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
{ | |
"found" : true, | |
"_id" : "DS-ALERTS", | |
"_version" : 769, | |
"status" : { | |
"state" : { | |
"active" : true, | |
"timestamp" : "2019-03-20T18:05:44.985Z" | |
}, | |
"last_checked" : "2019-03-21T20:05:58.249Z", | |
"actions" : { | |
"notify-pagerduty" : { | |
"ack" : { | |
"timestamp" : "2019-03-20T18:05:44.985Z", | |
"state" : "awaits_successful_execution" | |
} | |
} | |
}, | |
"execution_state" : "execution_not_needed", | |
"version" : 769 | |
}, | |
"watch" : { | |
"trigger" : { | |
"schedule" : { | |
"interval" : "60m" | |
} | |
}, | |
"input" : { | |
"search" : { | |
"request" : { | |
"search_type" : "query_then_fetch", | |
"indices" : [ | |
"dslogs-*" | |
], | |
"types" : [ ], | |
"body" : { | |
"query" : { | |
"bool" : { | |
"must" : [ | |
{ | |
"term" : { | |
"beat.ip" : "10.7.1.109" | |
} | |
} | |
], | |
"filter" : [ | |
{ | |
"range" : { | |
"@timestamp" : { | |
"gte" : "now-60m" | |
} | |
} | |
} | |
], | |
"should" : [ | |
{ | |
"match_phrase" : { | |
"levelname" : "CRITICAL" | |
} | |
} | |
], | |
"minimum_should_match" : 1 | |
} | |
} | |
} | |
} | |
} | |
}, | |
"condition" : { | |
"compare" : { | |
"ctx.payload.hits.total" : { | |
"gt" : 0 | |
} | |
} | |
}, | |
"actions" : { | |
"notify-pagerduty" : { | |
"throttle_period_in_millis" : 300000, | |
"pagerduty" : { | |
"description" : "ATTENTION: critical logs found in last 1hour and triggered at {{ctx.execution_time}}", | |
"client_url" : "https://kibana1.corp.mycompany.com/", | |
"attach_payload" : true, | |
"account" : "team1", | |
"contexts" : [ | |
{ | |
"type" : "link", | |
"href" : "https://mycompany.pagerduty.com" | |
}, | |
{ | |
"type" : "link", | |
"href" : "https://mycompany.pagerduty.com", | |
"text" : "View the incident on {{ctx.payload.link}}" | |
} | |
] | |
} | |
} | |
}, | |
"metadata" : { | |
"name" : "Data-service-critical-alerts", | |
"xpack" : { | |
"type" : "json" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment