Splunk Search

Getting text from raw event with regex

g_paternicola
Path Finder

 

Hi everyone, 

I'm trying to get a simple text from a raw event, but I can't make it works.

The event looks like this:

2021-09-13_15-24-17.png

and my regex looks like this:

| rex field=_raw "Allow\s(?<GroupName>\w.+)\s+Enroll" 

my issue is, that I only going to get a few of those groups, but not all... for example I will get the Domain Users but not the Enterprise Users which is in the same raw file...

Could please someone help me with this regex?

Labels (3)
Tags (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

It's not clear to me what the problem is, but I think the rex command is not extracting all instances of the "Allow" field.  If so, then the max_match option should help.

| rex field=_raw max_match=0 "Allow\s(?<GroupName>\w.+)\s+Enroll" 
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

It's not clear to me what the problem is, but I think the rex command is not extracting all instances of the "Allow" field.  If so, then the max_match option should help.

| rex field=_raw max_match=0 "Allow\s(?<GroupName>\w.+)\s+Enroll" 
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...