Splunk Search

How to extract a field from raw using rex?

kavyamohan
Explorer
SVSCPLEX,S0W1,S0W1.DAL-EBIS.IHOST.COM,SYSLOG,zOS-SYSLOG-Console,SYSLOG,-0400,NE,001C,19283 01.21.46.880
 -0500,S0W1    ,JOB03487,        ,40000000000000000000000000000000,00000090,TESCREAT,00," IEF450I TESCREAT STEP010 - ABEND=S222 U0000 REASON=00000000"\n

How to extract JOB03487 from this _raw? can anyone help?

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi kavyamohan,
try this

| rex "([^7]*,){5}(?<job>[^,]*),"

you can test it at https://regex101.com/r/eW7oCi/1

Ciao.
Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi kavyamohan,
try this

| rex "([^7]*,){5}(?<job>[^,]*),"

you can test it at https://regex101.com/r/eW7oCi/1

Ciao.
Giuseppe

kavyamohan
Explorer

Thank you it worked

0 Karma
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 ...