Splunk Search

How to extract key value pair from string?

Mofizul
Loves-to-Learn Lots

Have a search result as

GET https://…. | Status: 403 | Message: Forbidden | Duration: 166 | x-req-id: ssv5s-ssy67-78vshb | x-correlation-id: vsvsuj-75sys7-sbbjs7

 

Need to extract value of x-req-id .

 

Tried this extract pairdelim="|" , kvdelim=":" ,which gives Status & Message & Duration but not able to fetch  x-req-id

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

This works for me - which version of splunk are you using?

| makeresults
| eval _raw="GET https://…. | Status: 403 | Message: Forbidden | Duration: 166 | x-req-id: ssv5s-ssy67-78vshb | x-correlation-id: vsvsuj-75sys7-sbbjs7"
| extract pairdelim="|" kvdelim=":"
0 Karma

Mofizul
Loves-to-Learn Lots

Splunk 8.2.2.1

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Same here - so does my run anywhere example work for you?

0 Karma

Mofizul
Loves-to-Learn Lots

No its not working

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Do you get any errors reported which might help determine what the issue might be other than "its not working"?

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