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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...