Getting Data In

How to force Splunk to add additional (local) timestamp to events?

k1gto
Engager

I'd like to have Splunk add an additional (current) timestamp field to the events that I'm sending so that I can compare what my app thinks the time is, versus what the Splunk server says it is. I understand indexing can take some time and would naturally shift the time slightly, and that is ok. The sort of clock skew (between app server and indexing server) that I'm trying to expose is on the order of years.

My app is currently sending the time in the timestamp field of the events (JSON). Ideally I'd like to have Splunk add a field "timestamp_splunk" or something like that. Alternatively I'm happy to have Splunk set the timestamp field and have my app send the time in a different field.

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

All events have at least two timestamps, _time and _indextime. _time is usually set from a field in the event whereas _indextime is always set by Splunk to be the time the event was written to disk (roughly). If you are already setting _time from your data then _indextime may be what you are looking for. Note that you can't use _indextime directly in SPL commands - you must first assign it to another field ('eval it=_indextime', for example).

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

All events have at least two timestamps, _time and _indextime. _time is usually set from a field in the event whereas _indextime is always set by Splunk to be the time the event was written to disk (roughly). If you are already setting _time from your data then _indextime may be what you are looking for. Note that you can't use _indextime directly in SPL commands - you must first assign it to another field ('eval it=_indextime', for example).

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...