Regular expression is not working in Event Rule transformation

Upender Kumar
Mega Sage

I have to set up an Event Rule in Event Management. I need to get short description from the additional information.

When I am creating expression with dragging the mouse it is working but when I am writing custom regular expression it is not working.

Sample Event Additional Info

 

 

 

{"generic_trap":"6","iso.org.dod.internet.private.enterprises.1":"BSMSC IEA491E C610,RMMS05,PPRC SUSPENDED, COMMUNICATION TO SECONDARY FAILURE, (PRI)=0175-GXH11,CCA=10 (SEC)=0100-LMY51,CCA=10,SENSE=10901000 10FFFFFB 32100400 195E9704 E528DD23 1006FE32 00006080 0B000000 20230405 04:00:01 N/A N/A LOOP IEA491E C610,RMMS05,PPRC N/A N/A N/A N/A","specific_trap":"1","enterprise":"iso.org.dod.internet.private.enterprises.1.1588.1.3","int_ev_type":"SNMP","peer_address":"172.25.6.1","agent_address":"172.25.6.1","timestamp":"99"}

 

 

 

 Below Desc is with regular expression and shrt is with dragging mouse.

UpenderKumar_0-1680687417704.png

UpenderKumar_1-1680687522112.png

Required out put is text between 

BSMSC and N/A

i.e IEA491E C610,RMMS05,PPRC SUSPENDED, COMMUNICATION TO SECONDARY FAILURE, (PRI)=0175-GXH11,CCA=10 (SEC)=0100-LMY51,CCA=10,SENSE=10901000 10FFFFFB 32100400 195E9704 E528DD23 1006FE32 00006080 0B000000 20230405 04:00:01

 

When I am checking for regex on regex101.com, it is giving me the valid output.

UpenderKumar_0-1680688371456.png

 

1 ACCEPTED SOLUTION

Harsh3
Kilo Guru

Hi in regex use below 

BSMSC(.*?)(?=N[\/]A).*

 

just added .* in the end. its kind of a limitation with event rule, we have to like select whole data present and capture in brackets the information we needed.
you can find screenshot for reference.
If issue got resolved please mark this helpful. 🙂

View solution in original post

2 REPLIES 2

Harsh3
Kilo Guru

Hi in regex use below 

BSMSC(.*?)(?=N[\/]A).*

 

just added .* in the end. its kind of a limitation with event rule, we have to like select whole data present and capture in brackets the information we needed.
you can find screenshot for reference.
If issue got resolved please mark this helpful. 🙂

bhembrom
Tera Contributor

We are having the same problem, when we tried to use custom RegEx to capture a value  between 1st and 2nd dot(.) from a field using this RegEx - /\.([^.]*)\./ Our Event Rule didn't able to process it.

 

Example -

abc1.auc-001.ao-xyz.co

xyz2.ccd-005.xo-abc.io

 

we need to extract the value of "auc-001" and other values before and after this string could be any character.