Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Parse JSON from AWS SNS

Dmitry Petriev November 22, 2022

Hi! How can I parse messages from AWS SNS in JSON format for getting the "attributes.severity" value?

I have alert manager with next configuration.

Could anyone tell me how OpsGenie parse JSON messages?

Снимок экрана 2022-11-22 в 15.52.48.png

3 answers

2 accepted

1 vote
Answer accepted
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 24, 2022

For visibility to Community, we were able to get the priority parsing as expected by using this custom field @Dmitry Petriev already was extracting, but replaced it into the Custom Value to Opsgenie Priority:

prior1.jpg

 

For more on extracting custom fields as well, this Community Article might be helpful for others!

How to Extract Custom Fields and Data into an Alert

1 vote
Answer accepted
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2022

Hi @Dmitry Petriev ,

This article might help on how to extract "P2" into the alert: How to Extract Custom Fields and Data into an Alert

It'd realistically depend on how this field / value is being parsed in the alert's payload. I believe you're sharing what is sending from Alertmanager or AWS, so you'd want to review the Opsgenie Logs tab to get a better idea on what string processing or regex can be used.

Dmitry Petriev November 22, 2022

I did it, but it doesn't work in the Снимок экрана 2022-11-22 в 17.56.55.pngСнимок экрана 2022-11-22 в 17.56.31.pngway I want. Could you tell me why the priority is still P3, but the value is P2?

Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2022

We'd have to review the entire payload / Logs to provide a reason why this might not be parsing as expected.

Please open a ticket with Opsgenie support so we can review your account: https://support.atlassian.com/opsgenie/

Like # people like this
0 votes
Dmitry Petriev November 22, 2022

So, the task became easy: how to parse such part of JSON in extra properties field AWS SNS Integration:

"MessageAttributes" : {
"value" : {"Type":"String","Value":"P2"},
"key" : {"Type":"String","Value":"severity"}

 I need to catch "P2"

Dmitry Petriev November 22, 2022

{{MessageAttributes.value.Value}} doesn't works

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events