Getting Data In

What PCRE regex can we use in our transforms.conf?

roopeshetty
Path Finder

Hi

 

We need to ingest only those events which starts with any of the below strings ; (please note  its starts with not contains

 

create, drop, login, logout, alter, delete

 

For example

“ login success for user Peter”  

"create action success for user Martin"

 

 

we have edited the transforms.conf as below

 

[setnull]

REGEX = .

DEST_KEY = queue

FORMAT = nullQueue

 

[setparsing]

REGEX = login|logout!|create|drop|alter|DELETE

DEST_KEY = queue

FORMAT = indexQueue

 

But this is allowing all events which contains above strings. But our requirement is event should start with above strings;

 

Could you please help us with a PCRE regex for above conditions on transforms.conf?

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @roopeshetty ,

the symbol for starting log is "^", so you should try  this:

REGEX = ^login|logout!|create|drop|alter|DELETE

or

REGEX = ^(login|logout!|create|drop|alter|DELETE)

probably the second is the orrect one.

Ciao.

Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...