Splunk Search

How to search non-header CSV format data with Hunk?

cwl
Contributor

I am using Hunk 6.2.1 and I have some csv format data saved in my hadoop cluster which doesn't have csv header.
By default it seems like Hunk is recognizing the first line of my csv format data as header and not data.
Is there a way to search this kind of data so Hunk doesn't think that the first line content is csv header ?

Tags (3)
1 Solution

cwl
Contributor

By default, Hunk will use SimpleCSVRecordReader reader to process csv files and convert csv to json.
By using SplunkLineRecordReader, you can avoid this conversion which enables you to use Splunk Enterprise's search time field extractions settings.
So you will need to use the default line reader to let the splunk parsing pipelines do all the event breaking etc.
To use the default line reader you will need to add "vix.input.1.recordreader = SplunkLineRecordReader" in you virtual index.

[sampledata] 
vix.input.1.path = /data/... 
vix.provider = cdh4 
vix.input.1.recordreader = SplunkLineRecordReader 

View solution in original post

cwl
Contributor

By default, Hunk will use SimpleCSVRecordReader reader to process csv files and convert csv to json.
By using SplunkLineRecordReader, you can avoid this conversion which enables you to use Splunk Enterprise's search time field extractions settings.
So you will need to use the default line reader to let the splunk parsing pipelines do all the event breaking etc.
To use the default line reader you will need to add "vix.input.1.recordreader = SplunkLineRecordReader" in you virtual index.

[sampledata] 
vix.input.1.path = /data/... 
vix.provider = cdh4 
vix.input.1.recordreader = SplunkLineRecordReader 

burwell
SplunkTrust
SplunkTrust

Thanks SO much for this post. I can't find SplunkLineRecordReader documented anywhere.

We had non-compressed CSV data that was comma separated. When I used SimpleCSVRecordReader it did indeed treat the data as JSON. Not sure why? And this was bad as I was getting pairs of data.

The solution was vix.input.1.recordreader = SplunkLineRecordReader as listed above.

Thanks again.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...