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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...