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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...