Hi Splunkers!
I wish to get data in a specific time range using earliest and latest command .
I have checked with time picker events are there within the specified range.
But when I am trying to run a spl query its not working :
I have tried with ISO format and custom format as shown below .
When I use ISO format its giving error
index=main sourcetype="access_combined_wcookie" earliest="2024-01-15T20:00:00" latest="2024-02-22T20:00:00"
And when I use custom format as shown below its returning 0 events:
index=main sourcetype="access_combined_wcookie" earliest="1/15/2024:20:00:00" latest="2/22/2024:20:00:00"
Please help I want to do this using earliest and latest command only
And when I use custom format as shown below its returning 0 events:
index=main sourcetype="access_combined_wcookie" earliest="1/15/2024:20:00:00" latest="2/22/2024:20:00:00"
If you read the document @PickleRick posted, you know that this is the only accepted format. To diagnose why you get zero return, you have to prove that you had events in that period. In other words, what makes you think 0 is not the correct result? Is it possible that your events were not ingested with the correct _time value? Forget half years ago. Does searches like
index=main sourcetype="access_combined_wcookie" earliest=-1d
return the correct results? How about the first month of the year?
index=main sourcetype="access_combined_wcookie" earliest=-0y@y latest=-0y@y+1mon
All this is to say, without proper context (raw data, event frequency, etc.), your question is unanswerable.
https://docs.splunk.com/Documentation/Splunk/latest/Search/Specifytimemodifiersinyoursearch
But you can also (and it saves you issues with time zones) specify it as epoch timestamp.
Your custom format (mm/dd/yyyy:HH:MM:SS) should work assuming you have events in the specified time range