Getting Data In

Strip leading junk to index json

ntripp_element
Explorer

I have some json coming in from syslog and there's a bunch of added junk that's inhibiting the field extraction.

I tried 

transforms.conf

[eliminate_header]
REGEX=s/^[^{]+//g
DEST_KEY=queue
FORMAT=nullQueue

and

props.conf

[syslog_cue]
TRANSFORMS-t1=eliminate_header

and a couple other things but can't quite seem to get the outcome I want. Testing the regex works, but isn't helping in the way I need it to. 

Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Please provide examples of the original data and the desired output.  It's almost impossible to solve regex problems without that.

That said, the REGEX line shown is not valid in transforms.conf.  Sed commands are not supported so the regex contains unescaped delimiter characters (slashes).

Additionally, FORMAT=nullQueue discards entire events that match the REGEX, not just the text that matches.

You probably want to use SEDCMD in props.conf.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Please provide examples of the original data and the desired output.  It's almost impossible to solve regex problems without that.

That said, the REGEX line shown is not valid in transforms.conf.  Sed commands are not supported so the regex contains unescaped delimiter characters (slashes).

Additionally, FORMAT=nullQueue discards entire events that match the REGEX, not just the text that matches.

You probably want to use SEDCMD in props.conf.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...