Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Concatenating Message Key with Extracted Drive Information

Durgaprasad Joi
Tera Contributor

Hello All

 

I need help in concatenating data from two different event fields. In ServiceNow Event Management, I want to create a unique message key using:

  1. The original message key
  2. Drive information available in the Type field

However, I do not need the complete value from the Type field. I only need the drive information, which I have already extracted using a regular expression in the Event Field Mapping and stored as the alert tag t_application.

Could you advise on the best way to concatenate the original message key with the t_application value to generate a unique message key? Or Is there any better way I can combine two different value into on field?

 

Message Key: 73340755

t_application: D

 

New message key we are expecting: 73340755_D

2 REPLIES 2

Hasini Chukka
Tera Contributor

Hi @Durgaprasad Joi ,

Yes, this can be done in the event rule, so you do not need to concatenate alert tags afterwards. Alert tags are created after the event is processed, so t_application cannot be used to build the message key.

Suggested approach:

  1. Open the event rule that matches these events (Event Management > Rules > Event Rules).
  2. In the Event Field Mapping, take the Type field and apply a regular expression to capture only the drive value.
  3. Map the result into the Message key field together with the original value, so the message key becomes the original message key, an underscore and the drive (for example 73340755_D).

HasiniChukka_0-1795086751180.png

 

Thanks for the response. I tried this method by mapping expression to 'Resource' Field. It did not work for me. I can try with 'Type' field and let you know the result.