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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...