- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 11:07 AM
I'm setting up an integration with Dynatrace SaaS, and I'm having trouble extracting one piece of data from the additional_info field.
We are receiving the Dynatrace 'tags' as part of the additional_info. There are multiple entries in this 'tag' field, and I need to extract one of them. The order of the tags in this field could be different every time.
The data is coming through like this:
"dt_Tags":"CI_ID:9f401c34db915fc4571a3a92ba961908, Role:Application Server, Country:Corp, Application:MAGIC Bonus, AppEnvironment:Theta, Region:Global"
So, of course the value of dt_Tags is:
CI_ID:CI_ID:xxx000555x76ad98325lkafd8, Role:Application Server, Country:Corp, Application:App Name, AppEnvironment:Theta, Region:Global
But, the tags could be in any order, so I could have:
Role:Application Server, Country:Corp, CI_ID:xxx000555x76ad98325lkafd8, Application:App Name, AppEnvironment:Theta, Region:Global
Or
Role:Application Server, Country:Corp, Application:App Name, AppEnvironment:Theta, Region:Global, CI_ID:xxx000555x76ad98325lkafd8
Using Regex101.com, I can extract the CI_ID using the following:
(?<=CI_ID:)(.*?)(?=$|\z|,)
https://regex101.com/r/m6NWaC/3
Note that the match information only lists 1 Group.
If I take that regex and put it in my Event Rule, it wants to generate 3 fields:
Note the 2 entries on the right for 'Select or Add Field'.
Is there any way to get that to be seen as a single group?
Solved! Go to Solution.
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 06:03 AM
If you need only the "CI_ID" field you can extract that like that:
CI_ID:\K[^,]*
see example: regex101
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 10:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2019 06:05 AM
Hi
You can see here in the docs that regex101 isn't the perfect match for this.
https://docs.servicenow.com/bundle/london-it-operations-management/page/product/event-management/task/t_EMComposeOuput.html
you can combine your testing with regex101 and https://www.freeformatter.com/java-regex-tester.html
both of them will bring you great infromation on how to use
Regards, Moshe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2019 10:24 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2018 10:46 AM
That is PHP regex, and wont even save in the Edit Regex Expression Popup. You need to use JavaScript regex.