Skip to main content

Need help to write regex for chronicle siem

  • March 22, 2024
  • 2 replies
  • 48 views

Forum|alt.badge.img+1

write a regex to capture value between @ and " for below string.
[{\\"ActionType\\":\\"Forward\\",\\"Recipients\\":[\\"Katrina.Demon@whxyz.co.um\\"],\\"ForwardFlags\\":\\"None\\"}]

which is whxyz.co.um in above string. 

or help write a yara code for capturing the same. 

I am trying below, but is it giving error.

re.capture ($e.security_result.detection_fields.value, "\\["([^"]+)"\\]") = $Domain

2 replies

David-French
Staff
Forum|alt.badge.img+9

Have you looked into having Chronicle parse these log events for you into UDM format so they're easier to search and utilize in your YARA-L rules?

Can you try the regex expression below?

 

(?:"Recipients\\\\.+@)([a-zA-Z0-9.-]+)

 

I tested it using the Golang regex engine on regex101.com. The screenshot below shows the non-capturing group match in blue and the capturing group match in green.

 


David-French
Staff
Forum|alt.badge.img+9

Feel free to post your questions in the Chronicle SIEM Forum in future. This one was posted in "General/Misc Q&A" and might not be seen by all of our Chronicle SMEs.