Splunk Search

How do I extract the value of a field value in Splunk?

newsplnkr
Explorer

Hello all,

I am trying to get the value of a field from an event in Splunk. The event looks like follows:

message="abtest platform=\"Target\", [testName=\"test1\",testId=\"253041,\",experience=\"lefNavigation\"]"

For the above event, how could I do a count by "testName", "testId" and "experience"? Currently, when I do count by on the message source, value for the above fields come as a backslash() .

Thanks a LOT in advance!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi newsplnkr,
did you tried with this regex?

message\=\"abtest platform\=\\\"(?P<abtest_platform>[^\\]*)\\\",\s*\[testName\=\\\"(?P<testName>[^\\]*)\\\",testId\=\\\"(?P<testId>[^,]*),\\\",experience\=\\\"(?P<experience>[^\\]*)

you can test it at https://regex101.com/r/g5u6kU/1

Bye.
Giuseppe

0 Karma

briancronrath
Contributor

In props.conf you should specify KV_MODE = auto_escaped for a sourcetype that has values like this

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 ...