Getting Data In

Why aren't timestamps being recognized consistently?

gregbo
Communicator

I'm index some HL7 v2 files, and sometimes Splunk recognizes the time zone in the timestamp one way, and other times another way. The message types are exactly the same, the source files are the same (just two different times). The field the timestamp is coming from has the values " 20180525054500000-0700" and "20180525073507000-0700"... in Splunk, date_zone for the first shows "-420" and for the second shows "0". The first one is interpreted correctly, but the second one is interpreted as UTC, so the event time is wrong. Both files just have the one event in them.

0 Karma

FrankVl
Ultra Champion

%Y%m%d%H%M%S%z doesn't match the timestamps you have.

%Y: 2018
%m: 05
%d: 25
%H: 05
%M: 45
%S: 00
???: 000 <-- you forgot to match that bit, which I guess is milliseconds?
%z:-0700

I think something like this comes closer: %Y%m%d%H%M%S%3N%z

0 Karma

FrankVl
Ultra Champion

Have you tried specifying the timestamp extraction settings explicitely, rather than letting Splunk guess?

0 Karma

gregbo
Communicator

I believe so, I've got TIME_FORMAT set to %Y%m%d%H%M%S%z, and I've got the TIME_PREFIX and MAX_TIMESTAMP_LOOKAHEAD set as well. I check the MAX_LOOKAHEAD, and it's set to capture all of the timestamp.

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