Hi all!
My monitoring tool send a bunch of tags which is encapsulated in the field {{dd_tags}}.
For example it sends:
"Datadog Tags": "Service:Appname, Team:Teamname" (tags found log)
When I use {{dd_tags}} in the advanced integration, it shows all the tags and values beautiful in the alert. But I want to have the value of a certain tag as a field (extra propertie), so I can use it for other things.
For example, add the property "Service" and put "Appname" as a value for that property.
But it can't find a way to do that. {{dd_tags}} works for a field, but when I try other things, like:
{{dd_tags.service}}
{{dd_tags.SERVICE}}
{{dd_tags.extract(/service: (\S+)/) }}
{{dd_tags.get(0)}}
{{dd_tags[0]}}
{{dd_tags.substring(5,20)}}
none of this works. What am I doing wrong?
https://docs.opsgenie.com/v1.0/docs/datadog-integration
So I want these tags as separate properties:
Hi @Bart Scheltinga ,
With the tag you shared above, Team:MVP , I believe you can use string processing or regex to extract the MVP value into an extra property:
https://support.atlassian.com/opsgenie/docs/string-processing-methods-in-opsgenie-integrations/
https://support.atlassian.com/opsgenie/docs/regular-expressions-for-improved-alert-filtering/
You might want to try testing with a few like:
Hope this helps! Let us know if any other these work.
For context as well - I did some testing on a Jira integration (since I do not have a DD instance) - but used some similar tags.
The issue with using something like {{dd_tags.get(0)}} - will only pull the first tag in the list alphabetically. So there might be inconsistency using the .get since this could change.
For example with 1 and 2 above - those pull the first two labels that are listed in the payload alphabetically:
So string processing and regex might be better options. For example with numbers 3, 4 and 5 in my first screenshot, those pulled these values:
Some of the other examples you shared:
{{dd_tags.service}}
{{dd_tags.SERVICE}}
^ I don't believe these would work since the tags are parsed as lists, and these would be used more for arrays.
{{dd_tags.extract(/service: (\S+)/) }}
^ You might be misspelling service, have some case-sensitivity issue, or adding an extra space after service:
Again, hope this helps with troubleshooting! Let us know if you run into any other questions, issues, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks so much for you extensive answer @Nick H
I'm not sure why it was not working in the first place, I thought I tried all of the possible options. Maybe Atlassian was having a bad day. or it was the case sensitivity. But the good news is, it is working now! ;-)
{{ dd_tags.substringBetween("Service:",",") }} <- Did the trick!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.