Getting Data In

How to pull out a header before indexing?

Bliide
Path Finder

I am attempting to index some SSRS logs. Each log file has a header at the beginning of the file. I would like to pull out the header before indexing. I attempted to use PREAMBLE_REGEX but I can not get it to work. The header always has the following format:

A LOT of text

I know there has to be a way to pull it out but either I am going down the wrong track with PREAMBLE_REGEX or I have a flaw in my code. Any advice is welcome.

Tags (3)
0 Karma
1 Solution

jayannah
Builder

Try this

[<< sourcetype >>]
TRANSFORMS-skiphdr= skip_header_logfile

[skip_header_logfile]
REGEX = << 20-30 characters of your header line >>
DEST_KEY = queue
FORMAT = nullQueue

View solution in original post

jayannah
Builder

Try this

[<< sourcetype >>]
TRANSFORMS-skiphdr= skip_header_logfile

[skip_header_logfile]
REGEX = << 20-30 characters of your header line >>
DEST_KEY = queue
FORMAT = nullQueue

mcronkrite
Splunk Employee
Splunk Employee

On your forwarder where you are getting this data update your props.conf with this line from @jayannah

[<< sourcetype >>]
TRANSFORMS-skiphdr= skip_header_logfile

Then create a transforms.conf in the same location and add these lines by @jayannah

[skip_header_logfile]
REGEX = << 20-30 characters of your header line >>
DEST_KEY = queue
FORMAT = nullQueue

Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...