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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...