Splunk Search

extract a value from raw field

alexanderschlau
Explorer

Hi ,


There is a way to extract a value from field even there is no = between Key and Value? After extracting I want to use them as a search criteria. Unfortunatelly I need to work with data which are not optimized for splunk.

For example : I have the following raw field:

"2020-12-16 13:39:00.7174 INFO 001d1764-80c3-4c35-87c7-ec25382b4328 IM_Contact with SetID Cardlink_DCDOB2012146196-1006 has current Status Completed. ContactID [CO-000085513778], CaseID [CA-000002980184] APOrchestrator.ProcessIncomingMessage => ServiceQueueOrchestrator`2.LogContactStatus => Logger.LogInfo"

 

I want to extract following key / values:

Info = 001d1764-80c3-4c35-87c7-ec25382b4328

SetID = Cardlink_DCDOB2012146196-1006

Status = Completed

ContactID = CO-000085513778

CaseID = CA-000002980184

 

Found some interesting answers but all of them working with real key value pairs (fields) as a basis.

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

That's easy to do with rex.

 

| rex "INFO (?<Info>\S+)"
| rex "SetID (?<SetID>\S+)"
| rex "Status (?<Status>)\w+)"
| rex "ContactID \[(?<ContactID>[^\]]+)"
| rex "CaseID \[(?<CaseID>[^\]]+)"

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

alexanderschlau
Explorer

great, so simple and works, thank 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma

alexanderschlau
Explorer

I think there is a little change in CaseID and ContactID needed but I got the principle

0 Karma

richgalloway
SplunkTrust
SplunkTrust

That's easy to do with rex.

 

| rex "INFO (?<Info>\S+)"
| rex "SetID (?<SetID>\S+)"
| rex "Status (?<Status>)\w+)"
| rex "ContactID \[(?<ContactID>[^\]]+)"
| rex "CaseID \[(?<CaseID>[^\]]+)"

 

---
If this reply helps you, Karma would be appreciated.
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...