Splunk Search

Splunk extract exact match for a customer name

balash1979
Path Finder

Here is my splunk log line

{"line":"2019-08-15T17:48:28.935Z LCS {\"configName\":\"Apple-SQS\",\"customerName\":\"Apple\"} INFO  i.r.p.s.Processor - finished processing}

When I search , I am trying the following

index=docker_logs_index  | search "Apple"

My search is catching Apple because Apple is part of configName but I only want to see results if customerName is Apple.
How can I modify my splunk query to accomplish that.

Tags (1)
0 Karma
1 Solution

mayurr98
Super Champion

Try this:

 .. | rex "customerName\\\\\":\\\\\"(?<customerName>[^\\\]+)" | search customerName="Apple"

OR

  | rex "customerName\\\\\":\\\\\"(?<customerName>\w+)" | search customerName="Apple"

View solution in original post

0 Karma

Sukisen1981
Champion

try this

 index=docker_logs_index | rex field=_raw "customerName\\\+\"+\:+\\\+\"(?<custname>.*?)\\\+\"" | where custname="Apple"
0 Karma

mayurr98
Super Champion

Try this:

 .. | rex "customerName\\\\\":\\\\\"(?<customerName>[^\\\]+)" | search customerName="Apple"

OR

  | rex "customerName\\\\\":\\\\\"(?<customerName>\w+)" | search customerName="Apple"
0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...