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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...