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
Get Updates on the Splunk Community!

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 4)

Welcome back to Splunk Classroom Chronicles, our ongoing series where we shine a light on what really happens ...

From GPU to Application: Monitoring Cisco AI Infrastructure with Splunk Observability ...

AI workloads are different. They demand specialized infrastructure—powerful GPUs, enterprise-grade networking, ...

Application management with Targeted Application Install for Victoria Experience

  Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...