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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,341
Community Members
 
Community Events
176
Community Groups

Get value from a list of datadog tags using advanced integration fields

Edited

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?

dd_tags.png

 

https://docs.opsgenie.com/v1.0/docs/datadog-integration

So I want these tags as separate properties:

2021-06-11 12_01_33-Datadog Integration.png

 

 

 

1 answer

1 accepted

1 vote
Answer accepted
Nick H Atlassian Team Jun 16, 2021

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:

  • {{ dd_tags.substringBetween("Team:",",") }}
  • {{ _payload.dd_tags.substringBetween("Team:",",") }}
  • {{ dd_tags.extract(/Team:(\S+)/) }}
  • {{ _payload.dd_tags.extract(/Team:(\S+)/) }}

 

Hope this helps! Let us know if any other these work.

Nick H Atlassian Team Jun 16, 2021

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.

tagscomm1.jpg

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:

tagscomm2.jpgtagscomm3.jpg

 

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:

tagscomm4.jpg

 

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.

Like Yener Azis likes this

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!

Like Nick H likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events