Splunk Search

What can be done when there is no date in the event?

danielbb
Motivator

We have cases in which there is no date in the log files, meaning, only the time of the event is in the data. What can we do in such cases?

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

In those cases, put DATETIME_CONFIG = current in the props.conf stanza for the sourcetype.

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

nickhills
Ultra Champion

If you are indexing the files as they are written (as opposed to batch or historic imports) Splunk will 'assume' that the date is "today"(actually, it will assume the date is the same as the log modification date or the date on which is its indexed)

This can be problematic in the few seconds around midnight, so it is not ideal.

Unless there is some other field you can get the date from (maybe the filename eg 01012020.log) Then realistically your options are:
Fix the app/logs
Accept midnight glitches

If my comment helps, please give it a thumbs up!

danielbb
Motivator

-- If you are indexing the files as they are written Splunk will 'assume' that the date is "today"

That's great

We also need to index original historic imports - what can we do there?

0 Karma

nickhills
Ultra Champion

Thats harder.
If you look at a historic log line, is there anyway to figure out what date it was generated?
Do the filenames contain dates?

If my comment helps, please give it a thumbs up!
0 Karma

danielbb
Motivator

-- Do the filenames contain dates?

They do!

0 Karma

nickhills
Ultra Champion

Ahh - you maybe ok then:
See here:
https://docs.splunk.com/Documentation/Splunk/8.0.1/Data/HowSplunkextractstimestamps

If my comment helps, please give it a thumbs up!
0 Karma

13tsavage
Communicator

Are these in Splunk logs or a specific application? I am assuming you will need to address the issue with the specific application's logging functionality to ensure full timestamps are being recorded that include time AND date of events.

0 Karma

danielbb
Motivator

These are specific application logs and the app team can't provide the date in the data.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...