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!

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...

Splunk Answers Content Calendar, June Edition II

Get ready to dive into Splunk Dashboard panels this week! We'll be tackling common questions around ...

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...