Getting Data In

Prevent escaping of special characters

bleinfelder
Path Finder

Hi there,

I'm reading files with fixed width fields into splunk. For extraction and masking of dedicated fields I need to adresse sth like "character 56 to 78". This generally works fine with regex.

Unfortunately the file contains some special characters like german umlauts or null chars, which are escaped with \xDC or \x00. As the number of special chars varies from line to line this escape mechanism destroys the fixed width contraint.

How can I prevent the escaping? Alternatively, how can I make splunk to do an escaping that maintains the fixed width constraint (that is, replace one char with exactly one other).

It would be nice to avoid using a custom preprocessor.

Regards,

Bernd

Tags (1)
0 Karma

bleinfelder
Path Finder

Hi Martin,

thank you for your support.

I tried adjusting the charset and could fix the issue regarding german umlauts with that (CHARSET = latin-1).

Nevertheless the null-char is still escaped - and I guess NUL is invalid in any charset. As my log source contains a fixed number of these chars, I could make it work anyway.

I would still regard it a useful feature to disable the escaping completely and replace invalid chars with a simple dot or sth similar.

Thanks,

Bernd

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could build an SEDCMD setting in props.conf to replace your NUL with a different char... not quite sure if that happens before or after escaping though, so you may need to look for both escaped and unescaped NULs and replace both.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Have you tried setting CHARSET in props.conf appropriately?

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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...