Getting Data In

Hunk - specify delimiter when using SplunkLineRecordReader

conwaygene
Engager

How does one specify the delimiter when using SplunkLineRecordReader? Trying to read in a csv file with a header and delimited by '|'. Currently, Splunk is reading in the line as one field.

Thanks.

Tags (3)
0 Karma

Ledion_Bitincka
Splunk Employee
Splunk Employee

Given that | is not part of commonly used CSV formats out there you'd have to use Hunk's delimiter based KV extraction by using props/transforms.conf

$SPLUNK_HOME/etc/apps/search/local/props.conf
[my-sourcetype]
REPORT-delim = pipe-extractor

$SPLUNK_HOME/etc/apps/search/local/transforms.conf
[pipe-extractor]
FIELDS = field1,field2, ....
DELIMS = | 

You can read a blog post about the technique here

conwaygene
Engager

Now working. You rock!

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...