Getting Data In

Prepend all lines forwarded with a timestamp

Kindred
Path Finder

Hi,

We have an application log that doesn't contain timestamps, but we'd actually like to have them within the raw event.

Is it possible (either on a Forwarder or at index time) to tell Splunk to prepend a timestamp to all lines it receives?

0 Karma
1 Solution

woodcock
Esteemed Legend

This is not possible with just splunk; you will have to pre-process the events on the forwarder using some other software.

View solution in original post

0 Karma

woodcock
Esteemed Legend

This is not possible with just splunk; you will have to pre-process the events on the forwarder using some other software.

0 Karma

Kindred
Path Finder

I thought as such since there are certain cases that would cause odd behaviour. When the forwarder is reading the file in (relatively) real-time and they are getting indexed in a similar amount of time, then the added log timestamp would be useful to understand the order of the events when looking at the logs afterwards (outside of Splunk), but since you may have network issues and delays in forwarding/reading the file - if it indexed the entire file at once they'd all have the same timestamp which isn't that useful.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

In your props.conf file put DATETIME_CONFIG=CURRENT in the appropriate sourcetype stanza(s).

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

Kindred
Path Finder

This adds a timestamp to the raw event? I thought that was just related to ordering? Will give it a try anyway and see.

0 Karma

woodcock
Esteemed Legend

It does NOT add it to the raw event but it causes the _time field to have the value of the time when the event was indexed on the indexer (roughly the time the event was forwarded from the forwarder).

0 Karma
Get Updates on the Splunk Community!

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...

UCC Framework: Discover Developer Toolkit for Building Technology Add-ons

The Next-Gen Toolkit for Splunk Technology Add-on Development The Universal Configuration Console (UCC) ...

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...