Help on Event Rule Regex

Tascha DeVoll
Kilo Contributor

Hello,

Can you guys help me translate this nodeName to a regex? I need the 'blankServer' parsed out at the end of the expression for my event rule.

/subscriptions/5611823-cf50-414d-9ace-2154113144/resourcegroups/5554-dahhda-dajjd-51554/providers/microsoft.compute/virtualmachines/blankServer
 
6 REPLIES 6

vNick
ServiceNow Employee
ServiceNow Employee

Hello - you should be able to do something like the following

(.*)virtualmachines\/(.*)

Event rule regex wants the entire string to be captured so even if you won't use the first group, it wants to capture it in a generic way and then the group after "virtualmachines/" will be the value you want to use

yzyrlr1
Tera Contributor

Hi VNick, did something change from Vancouver to Washington, because when we upgraded my Regex code stop working because in Event Management transform and Compose Alert Output, stop recognizing double quote as ", and start translating/displaying it to putting in the encoding code of &#34.  Can you please tell me how to get around this. I needed the ASAP! Please see attached images.  This happen recently when we update to Washington, prior to this update things were work excellent. help!. 

 

Roger L. Rush

Rahul Priyadars
Giga Sage
Giga Sage

Or u can use this- virtualmachines\/(.*)

 

find_real_file.png

 

Regards

RP

The regex for event rules is a bit more sensitive than that and the entire string has to be captured or it would only parse correctly if the entire beginning of the string was exactly the same each time.  The Xplore regex tester unfortunately does not use the same backend regex as event management rules (nor does regex101 or most other popular testers)