Splunk Search

PROPS Configuration for csv without Header Source files

SplunkDash
Motivator

Hello,

I have issues to write PROPS configuration file for following csv file (please see screenshot below for sample data) with No Header on it. Five columns showed in the screenshot are all values. Value of First Column also included below for better visibility.  Any help will be highly appreciated. Thank you so much.

Screenshot

malekmo_1-1631204934444.png

 

Value of First Column

sma2aa_L_0__20210906-194605_16305.html@^@^2020-09-10@^@^04:51:43@^@^sma2aa@^@^insert into "nTABLE_MIGRATION_INFO_current"( "user_name"

 

[csv]

SHOULD_LINEMERGE=FALSE

TIME_PREFIX=?

TIME_FORMAT=?

TIMESTAMP_FIELDS=?

HEADER_FIELD_LINE_NUMBER=?

INDEXED_EXTRACTIONS=csv

 

Labels (2)
Tags (1)
0 Karma
1 Solution

s2_splunk
Splunk Employee
Splunk Employee

OK, this should work in props.conf on your UF:

 

[mySourcetypeNameDontUseCSV]
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
INDEXED_EXTRACTIONS=csv
FIELD_NAMES=SQLFIELD,Field1,Field2,Field3,Field4
TIME_PREFIX=@\^@\^
TIME_FORMAT=%Y-%m%d@^@^%H:%M:%S

 

Change the sourcetype name such that it matches what you set in inputs.conf for the monitor stanza. Again, make it a descriptive name rather than generic "csv", depending on what type of log data this is (e.g. sql:querylog or somesuch). Always good to be explicit and descriptive.

Docs for timestamp recognition

View solution in original post

s2_splunk
Splunk Employee
Splunk Employee

Couple of questions:

- Where is this csv file picked up from, i.e. is it read by a UF?

- What field names do you expect to use?

- Which part of the first column do you want to be used as the event timestamp (there are multiple TS values)?

0 Karma

SplunkDash
Motivator

Thank you so much, appreciated your support.

Here are the answers of your questions

- Where is this csv file picked up from, i.e. is it read by a UF? Yes by UF

- What field names do you expect to use? SQLFIELD, Field1, Field2, Field3, Field4  

- Which part of the first column do you want to be used as the event timestamp (there are multiple TS values)? Highligter as Bold below (After  html@^@^)

sma2aa_L_0__20210906-194605_16305.html@^@^2020-09-10@^@^04:51:43@^@^sma2aa@^@^insert into "nTABLE_MIGRATION_INFO_current"( "user_name"

 

Thank you again.

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

OK, this should work in props.conf on your UF:

 

[mySourcetypeNameDontUseCSV]
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
INDEXED_EXTRACTIONS=csv
FIELD_NAMES=SQLFIELD,Field1,Field2,Field3,Field4
TIME_PREFIX=@\^@\^
TIME_FORMAT=%Y-%m%d@^@^%H:%M:%S

 

Change the sourcetype name such that it matches what you set in inputs.conf for the monitor stanza. Again, make it a descriptive name rather than generic "csv", depending on what type of log data this is (e.g. sql:querylog or somesuch). Always good to be explicit and descriptive.

Docs for timestamp recognition

s2_splunk
Splunk Employee
Splunk Employee

Assuming it's the first date/time value in the event you want to use as _time,  and we just name fields according to your column names, this should work:

 

[mySourcetypeNameDontUseCSV]
FIELD_NAMES = A,B,C,D,E
INDEXED_EXTRACTIONS = csv
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false

 

If this file is read by a UF, this props.conf entry must be placed on the UF itself, since you intend to use indexed extractions.

If you want a different part of the event for the timestamp, or if you just want to use index time, you'll need a couple more things.

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!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

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