Splunk Search

Formatting data to be parsed by splunk.

jcfergus
Engager

This seems like it should be such a straightforward thing, but having a hard time nailing down an answer we're happy with. Working on an in-house developed system, trying to update its logging into something which can be easily parsed into fields by Splunk. Logs will be picked up by light forwarded and sent along to indexing server.

Problem is just exactly how to format the data being written to the logs by the app. Ideal world would be key1=value1,key2=value2,key3=value3 (as per this ) so we can use autokv ... but there's the possibility that value could contain commas. So ... maybe we quote it? (key1="value1") But there's the possibility that values could contain quotes ... so let's backslash-escape the quotes. Nope, Splunk doesn't pay attention to the escaped quotes. Maybe we can URL-encode the data, and URL-decode at index time? Found this, and the bit in the comments sounds exactly like what we want ... except it doesn't seem to work.

So ... how to format arbitrary key-value pairs in logs to best be parsed by Splunk, when the value can contain pretty much any text character?

0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee
0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...