Getting Data In

If I have two timestamps in my log file, how can I choose one timestamp as the timestamp of the event?

manikantakomura
New Member

I have two timestamps in my log as shown below:

"#01#20180626-125301;969#19700101-000028;723#0046#01#GROUND#Y#4Y1651"

My sourcetype is written in a way to pick up the second timestamp within 5000 days. Now, since the date in the above example is 19700101, it attached the indexation time as the timestamp of the event. But is there a way to select the first time as the timestamp of the event when my second timestamp is invalid?

0 Karma

sudosplunk
Motivator

If you believe first timestamp is accurate at all times, then configure splunk to look at only first timestamp. Add below to your props.conf,

Assuming, timestamp always starts with "#<int>#

[sourcetype]
TIME_PREFIX = \"\#\d+\#
TIME_FORMAT = %Y%m%d-%H%M%S
MAX_TIMESTAMP_LOOKAHEAD = 15

manikantakomura
New Member

Thanks for your answer, but my first timestamp isn't accurate always. I only want to use the first timestamp when my second timestamp reads 1970

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...