Splunk Enterprise

How to extract Index time in multiple regex match?

GaetanVP
Contributor

Hello Splunkers,

I have a index-time field extraction question, here is my raw log :
wheel:x:10:user1,user2,user3

I would like to use props.conf and transforms.conf to extract the users

props.conf :

 

 

[mysourcetype]
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TRANSFORMS-users = get-users

 

 

transforms.conf :

 

 

[get-users]
REGEX = (\d:|,)(?<user>\w+)
FORMAT = users::$1

 

 

With my current config, I will only be able to extract the first match of my regex who is here the user1.
How could I extract and store each user value ?

Thanks for your time,
GaetanVP

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Index-time extractions don't have an equivalent to the max_match option of the rex command.  Consider extracting all users together and then extracting them at search time.

[get-users]
REGEX = (\d:)(?<user>.+)
FORMAT = users::$1

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Index-time extractions don't have an equivalent to the max_match option of the rex command.  Consider extracting all users together and then extracting them at search time.

[get-users]
REGEX = (\d:)(?<user>.+)
FORMAT = users::$1

 

---
If this reply helps you, Karma would be appreciated.

GaetanVP
Contributor

Hello @richgalloway

Thanks for the information, I will try to do that !

Regards,
GaetanVP

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...