Getting Data In

Can I ingest a comma separated text file as a csv file?

ddrillic
Ultra Champion

I have the following configurations deployed on the Universal Forwarder. However Splunk is incorrectly treating the first row of the file as the CSV header and using those values as field names. Instead, I want the events parsed as headerless CSV data, with the field names defined explicitly in the FIELDS parameter of the corresponding transforms.conf stanza.

> cat inputs.conf 
[monitor:///<path>] 
index = main 
sourcetype = xxx:test

> cat props.conf 
[xxx:test] 
SHOULD_LINEMERGE = false 
INDEXED_EXTRACTIONS = csv 
REPORT-fields = assign_csv_fields

> cat transforms.conf 
[assign_csv_fields] 
FIELDS = AccountNumber, Amount, Origin, TransactionCode, TransactionDate, TransactionTime, 
UNIQUEID, Counter, OFFSETACT, Filler

 

Labels (2)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

OK. Where are which settings defined?

With indexed extractions you have an option to define a header line (and I'm not sure if it's not defined by default).

If you want to explicitly provide a list of fields, it's probably better to _not_ use indexed extractions but use FIELD_DELIMITER and parse in search time.

View solution in original post

0 Karma

PickleRick
SplunkTrust
SplunkTrust

OK. Where are which settings defined?

With indexed extractions you have an option to define a header line (and I'm not sure if it's not defined by default).

If you want to explicitly provide a list of fields, it's probably better to _not_ use indexed extractions but use FIELD_DELIMITER and parse in search time.

0 Karma

ddrillic
Ultra Champion

Thank you @PickleRick !!

The following did it - 

INDEXED_EXTRACTIONS = csv
FIELD_NAMES=SQLFIELD,Field1,Field2,Field3,Field4,Field5,Field6,Field7,Field8,Field9

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Vibe-coding, AI, and Splunkcraft: Highlights from the .conf26 Builder Bar

If you stopped by the Builder Bar at .conf26, thank you! This year, we brought ...

Thanks for the Memories: .conf26 Took Learning to New Heights

Thank you, Splunk Community, for making .conf26 in Denver one for the books. From packed Splunk University ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...