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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions elastalert/opsgenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ def alert(self, matches):
post['description'] = body
post['source'] = 'ElastAlert'

formatted_tags = []
for i, tag in enumerate(self.tags):
self.tags[i] = tag.format(**matches[0])
post['tags'] = self.tags
formatted_tag = tag.format(**matches[0])
formatted_tags.append(formatted_tag)
post['tags'] = formatted_tags

if self.priority and self.priority not in ('P1', 'P2', 'P3', 'P4', 'P5'):
logging.warn("Priority level does not appear to be specified correctly. \
Expand Down