Getting Data In

ignoring the first row (column headers) in a CSV data source

jgautreau
Explorer

Hi,
When i input data from files & directories in splunk, is there a way to ignore the first row (column headers) in a CSV data source?

Thanks, John

Tags (4)

lukejadamec
Super Champion

Is the header row always the same? If so, then just create a regex that matches, and put that in the code I posted in the answer.

0 Karma

jgautreau
Explorer

Ah - i see how Props.conf can be configured when but how to i update the associated Transforms.conf file?

thanks! John

0 Karma

lukejadamec
Super Champion

You can use props.conf and transforms.conf to remove the header rows.

For example, if your header row starts with a # character, then the configuration would look like this:

Create these configs on the indexer.

Props.conf

[sourcetype]
TRANSFORMS-removeheader = removeheaderrow

Transforms.conf

[removeheaderrow]
REGEX = ^\#.*
DEST_KEY = queue
FORMAT = nullQueue

lukejadamec
Super Champion

Can you post an example of the header row?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...