Splunk Search

earliest=-1w does not work

GauriSplunk
Path Finder

Hi,
I have the following simple search.
sourcetype=ib:reserved1 source=ib:user:user_login index=ib_security earliest=-1w

When i run this search i do not get results. But when i remove the earliest command, I get the results.
All the results have todays date as time. So it should return result when I put earliest as 1 week back.

Why is earliest not working

Thanks

Tags (1)
1 Solution

GauriSplunk
Path Finder

the date on my events was greater than current date. (maybe the date on that machine was wrongly set).
So I believe it takes latest as now by default.
so earliest=-1w and latest = now , it didnt match the events.

If it didnt take any default value for latest, it would have worked.

View solution in original post

0 Karma

MuS
SplunkTrust
SplunkTrust

Running this search on Splunk 6.3.1 on Linux works:

index="_internal" sourcetype="splunkd" source="*metrics.log" earliest=-1w

It will return 450,072 events (before 11/10/15 9:19:03.378 AM)

0 Karma

GauriSplunk
Path Finder

the date on my events was greater than current date. (maybe the date on that machine was wrongly set).
So I believe it takes latest as now by default.
so earliest=-1w and latest = now , it didnt match the events.

If it didnt take any default value for latest, it would have worked.

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi GauriSplunk,

I converted your comment to an answer since it looks like you solved your time stamp issue/problem by setting a latest value in the search. Is that correct?

cheers, MuS

0 Karma

GauriSplunk
Path Finder

yes. thanks

0 Karma

woodcock
Esteemed Legend

I am sorry, I was careless and made a silly mistake in my testing and retract my confirmation of this problem. I am unable to reproduce it.

0 Karma

sundareshr
Legend

Does putting around source & sourcetype make any difference?

sourcetype="ib:reserved1" source="ib:user:user_login" index="ib_security" earliest=-1w

0 Karma

Richfez
SplunkTrust
SplunkTrust

No, I tried again with and without quotes around various pieces but just can't make it misbehave. I've also tried the various pieces individually and in various combinations. If GauriSplunk can reproduce this at will, I expect Splunk Support will definately want to take a look at this.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Make Your Machine Data AI-Ready in Splunk

Every team is getting ready for AI agents.   Thursday, November 12, 2026  |  11AM  PST / 2PM EST   ...

Splunk Asynchronous Forwarding Explained

Splunk asynchronous forwarding is often misunderstood as simply setting autoLBVolume. That is not quite right. ...

How to Monitor AI Agents with Splunk Agent Observability

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...