Splunk Search

How to escape equal signs (=) in key value data?

helge
Builder

Some of our data is logged in key value format separated by an equal sign (=), e.g.:

field1=data1 field2=data2

Splunk's auto-extractions works very well with that. However, if a field's data contains an equal sign, things work, but are not perfect. Take a look at this example:

ComputerNameDn="CN=XD71DDC,OU=Computers,OU=HK,DC=hk,DC=test"

As expected, the field ComputerNameDn is exctracted with the data CN=XD71DDC,OU=Computers,OU=HK,DC=hk,DC=test. So far, so good. But I get additional fields:

CN -> XD71DDC
OU -> Computers
DC -> hk

I don't want those. How can I escape the equal sign in the data so that the additional fields do not get extracted?

woodcock
Esteemed Legend

You can create your own KV_MODE extractions like this:

props.conf:

REPORT-kvmode = double_quote_kvps

transforms.conf:

[double_quote_kvps]
FORMAT = $1::$2
MV_ADD = 1
REGEX = ([^=\s]+)="([^"]+)"
SOURCE_KEY = _raw

helge
Builder

Unless I am misreading your regex it breaks when there are escaped double quotes, e.g. MyKey="a=1, b=2, c="1 or 2""
Not sure how to make the backslashes appear correctly in these comments, I am afraid.

0 Karma

woodcock
Esteemed Legend

You did not mention escaping double-quotes so I did not address it. My answer does not really change: build your own.

0 Karma

helge
Builder

Thanks. I understand that I can define my own extraction with a regex. I would prefer to simply escape the equal sign, though. However, that does not seem to be possible, right?

0 Karma

woodcock
Esteemed Legend

Correct; you can not tune the built-in stuff to that degree; you have to clone your own.

jordilazo
Explorer

Hi Woodcock,

I'm having the same problem that HELGE mentioned.
I have created my own KV_MODE as you gave in the solution but I still get the same error.

Can you confirm that even if I have created my own KV_MODE IT IS NOT POSSIBLE to skip the equal symbol (=)? (Splunk keeps creating different fields whenever it finds an = inside the value).

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