- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 02:42 AM - edited 04-05-2023 02:53 AM
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.
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 09:56 PM
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. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 09:56 PM
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. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 06:20 AM
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.