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
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

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