Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Incorrect Opsgenie Tags Formatting #2884

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abhishekjiitr
Copy link
Contributor

@abhishekjiitr abhishekjiitr commented Jul 10, 2020

When there are multiple matches in a single run of ElastAlert and the Opsgenie Tags are dynamic (deriving value from matching documents) then when the tag field for each unique alert is formatted only from the values of the first match. e.g.

Input:

opsgenie_tags: ["user"]
matches: ["alice", "bob"]

Expected Alerts:

Alert1: opsgenie_tags: ["alice"]
Alert2: opsgenie_tags: ["bob"]

Actual Alerts:

Alert1: opsgenie_tags: ["alice"]
Alert2: opsgenie_tags: ["alice"]

Fix

Instead of formatting a tag and changing its value in the entire objects state(self.tags), make a new variable that stores the formatted value, and directly add it to the post object that will be sent by the Opsgenie Alerter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant