Skip to content

OpsGenie: closing alerts automatically (using match_body) #1216

Locked Answered by vitalinoborges
vitalinoborges asked this question in Q&A
Discussion options

You must be logged in to vote

I resolved the automatic closing of resolved alerts in Opsgenie with the following procedures.

1) Enable the mapping of fields of the match_body object:


2) Create a script that receives the "alias" and "apiKey" of Opsgenie and executes a curl to close the alert.


3) Change the Dockerfile to copy the script into the image.



I used a "command" type alert to call the script. Example:

    k8s_deployment_ok: |-
      ---
      name: Deployment is back online
      type: flatline
      index: elastalert
      query_key: "match_body.kubernetes.deployment.name"
      use_terms_query: true
      doc_type: _doc
      filter:
      - query:
          query_string:
            query: "rule_name:\…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@jertel
Comment options

@vitalinoborges
Comment options

@nsano-rururu
Comment options

@nsano-rururu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by vitalinoborges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants