Splunk Search

Regex to extract status[number] alone from extracted field

Bhuavana
Explorer

Hi,

I have two below field[rstatus] values extracted from events

response.status = 200
response.status = 404

Can you share the regex to extract number[i.e 200 or 404 alone ] from above string.

Tags (2)
0 Karma
1 Solution

gfuente
Motivator

Hello

try this regex:

...| rex field="rstatus" "response\.status\s\=\s(?<yourfield>\d+)" | ...

Regards

View solution in original post

0 Karma

gfuente
Motivator

Hello

try this regex:

...| rex field="rstatus" "response\.status\s\=\s(?<yourfield>\d+)" | ...

Regards

0 Karma

Bhuavana
Explorer

Thanks a lot.. above solution is worked...

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...