Getting Data In

CSV Timestamp Problem

harald_leitl
Path Finder

Hi,

I have a problem with extracting the timestamp from an csv file.

Somehow Splunk recognizes the DATE as Date and Time.

Here is a sample of my CSV Log file:

123456;textA;08.03.10 07:54:43;textB;textC;textD

Here is the result I get from the search:

08.03.10 08:03:10,000

123456;textA;08.03.10 07:54:43;textB;textC;textD

As you can see date and time is the same.

Here is what I expect to see:

08.03.10 07:54:43,000

123456;textA;08.03.10 07:54:43;textB;textC;textD

My props.conf:

[myCSVsourcetype]

TRANSFORMS-null=setnull
TIME_FORMAT = %d.%m.%y %%H:%M:%S
TIME_PREFIX = ^\d+\;\S+\;

My transforms.conf: (to remove header)

[setnull]
REGEX = ^(.*\n){1}
DEST_KEY = queue
FORMAT = nullQueue

what am I doing wrong?

why does splunk not recognize the time from the log?

using Splunk 6.0.2.

CSV file is created and moved to an indexing directory once a day.

Thanks!

0 Karma

harald_leitl
Path Finder

changed the typo

0 Karma

lguinn2
Legend

You have a typo in your time format:

TIME_FORMAT = %d.%m.%Y %%H:%M:%S

should be

TIME_FORMAT = %d.%m.%y %H:%M:%S

Also, are you sure that textA will never have any whitespace characters? Perhaps your time prefix should be

TIME_PREFIX=.*?;.*?;
0 Karma

harald_leitl
Path Finder

my bad, was a typo in my question. i do have %d.%m.%y %H:%M:%S configured in my props.conf.
I also tried your TIME_PREFIX regex, didn't work. Somehow Splunk always recognizes the date as date and time as I described above. any other idea? thanks.

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...