Getting Data In

CSV Timestamp issue

drangzt
New Member

I am struggling to get splunk to parse the timestamps properly in a CSV file (Firefox Web History log exported to CSV). I tried the default CSV type, and all I get is the CSV file's modtime listed as the timestamps. Here are the first few lines of the CSV (redacted):

4/3/07 0:36, some url,html,????

4/3/07 0:35,some url, html,?????

4/3/07 0:34,some url,html, ????

Here is what I have added to my props.conf file:

TIME_FORMAT = %M/%D/%Y %H:%M

SHOULD_LINEMERGE = false

MAX_TIMESTAMP_LOOKAHEAD = 19

Same error. Any advice appreciated as I am new to splunk and still figuring it out.

Tags (2)
0 Karma

kristian_kolb
Ultra Champion

You should probably try a different set of strptime/strftime variables. Currently you define your TIME_FORMAT as

minute/full date/year hour:minute

I'd try to change this into

TIME_FORMAT = %D %H:%M

%D = m/d/y

for more info, see; http://www.strftime.net

/K

0 Karma

kristian_kolb
Ultra Champion

Good point. Though I seem to remember that Splunk can handle optional leading zeroes. But to be more exact, try;

TIME_FORMAT = %m/%e/%y %k:%M

There is (afaik) no 1-12 format for months, %m requires 01-12. Also, if your hours are 1-12 use %l (lower-case L) instead of %k (which is 0-23).

http://docs.splunk.com/Documentation/Splunk/5.0.4/SearchReference/Commontimeformatvariables

0 Karma

Ayn
Legend

There's also the issue with that %H assumes a two-digit value, so the hour "0" would not be understood (it expects "00"). %k is the equivalent without leading zero. Same goes for the day of the month (%e is without leading zero), etc.

drangzt
New Member

Tried your suggestion and same problem. Note: I did make sure that the source file was re-indexed.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...