Getting Data In

How to extract a specific work from Splunk logs?

Manth
Explorer

I would like to extract status value (i.e. 201) highlighted below using RegEx in the following link. However, it didn't work. Please advise

https://regex101.com/r/QIB8EG/1

Rex \"status\":(?<status>[^\}])\",\"requestId\":

 

{"level":"debug","message":"handler result : {\"body\":\"{\\\"numberOfProcessedRecords\\\":1}\",\"status\":201}","requestId":"ecd06f97-975b-5faf-81a0-3431fb4d1070"}

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

gcusello
SplunkTrust
SplunkTrust

Hi @Manth,

please try this:

\"status\\\":(?<status>\d+)

that you can test at https://regex101.com/r/QIB8EG/2

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @Manth,

please try this:

\"status\\\":(?<status>\d+)

that you can test at https://regex101.com/r/QIB8EG/2

Ciao.

Giuseppe

Manth
Explorer

Thank you @gcusello .

When I have my splunk query as below, I was expecting Status in the SELECTED FIELDS, however, I don't see the Status filed in the left menu. Am I doing anything wrong here. Please advise.

index=application source="aws:lambda"  | rex "\\"status\\":(?<Status>\w+)}\""

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Manth,

if you create a field using rex, by default you have this field in interesting fields not in Selected fields.

If you want it in Selected fields, you have to select it!

Ciao.

Giuseppe

0 Karma

Manth
Explorer

Thank you @gcusello 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Manth,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Tiling

This puzzle (first published here) is based on finding groups of tessellated tiles (inspired by floor tiles I ...

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...