Splunk Search

Regex not working as expected

cyber_castle
Path Finder

For one of the Security usecase, we need to extract Group Memberships from the Domain. The trickier part is some of the Group Memberships doesnt have domain name in front of it.

I am attaching the Regex link which is working fine on Regex101-

https://regex101.com/r/X2YAAd/1

but for some strange reasons, when i use the same regex on Splunk its not working.

This is to extract Group membership on EventCode=4627

Could anyone help me here..

Tags (2)
0 Karma

KARANMALHOTRA
Path Finder

Can you elaborate what you mean by "same regex is not working on Splunk"?

One problem may be that you are not using any names for the groups, so Splunk does not know what to name the field.

Also, if you need multiple matches, try using the max_match option.

0 Karma

skalliger
SplunkTrust
SplunkTrust

Always set the RegEx engine to Python. Also try to set (?ms) in front, that should do.

Skalli

0 Karma

cyber_castle
Path Finder

Ahh.. i have always used PCRE. When I have changed to python its blank.

0 Karma

skalliger
SplunkTrust
SplunkTrust

The https://regex101.com/r/X2YAAd/1 of your original post works for me when adding (?ms) at the beginning and using Python. Did you try that in Splunk?

Skalli

0 Karma

cyber_castle
Path Finder

Hello I have tried with the capturing group and still no luck

https://regex101.com/r/X2YAAd/2

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...