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!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...