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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...