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?
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.
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:
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
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"
{{MessageAttributes.value.Value}} doesn't works
I did it, but it doesn't work in the way I want. Could you tell me why the priority is still P3, but the value is P2?
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/
It looks like you're new here. Sign in or register to get started.