Splunk Search

How to get datetime of file on basis of its generation not upload

harshal_chakran
Builder

Hi,
Generally splunk indexes the events on basis of upload date-time. I want to it to get indexed on basis of its generation time.

Please Help...!!!

0 Karma

MuS
Legend

Hi harshal_chakranarayan,

Splunk uses the following precedence rules to assign time stamps to events:

  1. Splunk looks for a time or date in the event itself using an explicit TIME_FORMAT, if provided. You configure TIME_FORMAT in props.conf.

  2. If no TIME_FORMAT was configured for the data, Splunk attempts to automatically identify a time or date in the event itself. It uses the event's source type (which includes TIME_FORMAT information) to try to find the timestamp.

  3. If an event doesn't have a time or date, Splunk uses the timestamp from the most recent previous event of the same source.

  4. If no events in a source have a date, Splunk tries to find one in the source name or file name. (This requires that the events have a time, even though they don't have a date.)

  5. For file sources, if no date can be identified in the file name, Splunk uses the file's modification time.

  6. As a last resort, Splunk sets the timestamp to the current system time when indexing each event.

kudos go to docs team for this

cheers, MuS

aelliott
Motivator

do your events have timestamps on them?

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...