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!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...