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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...