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
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 ...