Getting Data In

Timestamp extraction

pdjhh
Communicator

Hi,

I've got a csv file with the a date field against events in the format 1-July-2016. Can I create a sourcetype to recognise this as the timestamp for this data set?

Thanks.

0 Karma

jkat54
SplunkTrust
SplunkTrust

Yes,

In props.conf you can use the following:

INDEXED_EXTRACTIONS = < CSV|W3C|TSV|PSV|JSON >
* Tells Splunk the type of file and the extraction and/or parsing method
Splunk should use on the file.
CSV - Comma separated value format
TSV - Tab-separated value format
PSV - pipe "|" separated value format
W3C - W3C Extended Extended Log File Format
JSON - JavaScript Object Notation format
* These settings default the values of the remaining settings to the
appropriate values for these known formats.
* Defaults to unset.

TIMESTAMP_FIELDS = [ ,..., ]
* Some CSV and structured files have their timestamp encompass multiple
fields in the event separated by delimiters. This attribute tells Splunk to
specify all such fields which constitute the timestamp in a
comma-separated fashion.
* If not specified, Splunk tries to automatically extract the timestamp of
the event.

Note:
* This feature and all of its settings apply at input time, when data is
first read by Splunk. The setting is used on a Splunk system that has
configured inputs acquiring the data.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi pdjhh,
yes this is the correct method.
I suggest to use the web interface to find the correct format and sourcetype definition.
With CSV you can set the time field in sourcetype definition.

Anyway, your time format is

%d-%B-%Y

Remeber that ingesting CSV inputs, you have to put props.conf on Indexers and also on Forwarders.

Bye.

Giuseppe

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 ...