Dashboards & Visualizations

How to change my earliest and latest time in the search string (not using timerange picker to change)

shariinPH
Contributor

Hello ! 🙂
I want to change my earliest and latest time in line with my search string. I dont have to use the time range picker because it has a separate date range.

index=rbi sourcetype=change earliest=-1month@month latest=@month|stats latest(cm_actualsched) as pmas

thanks for the help splunkers!

0 Karma
1 Solution

jeffland
SplunkTrust
SplunkTrust

I believe that when you set latest=now() and leave earliest blank, you get an all time search.

View solution in original post

twollenslegel_s
Splunk Employee
Splunk Employee

Per https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/SearchTimeModifiers earliest=1 should be used.

If you want to search events from the start of UNIX time, use earliest=1.

When earliest=1 and latest=now() are used, the search runs over all time.

0 Karma

jeffland
SplunkTrust
SplunkTrust

I believe that when you set latest=now() and leave earliest blank, you get an all time search.

shariinPH
Contributor

thanks @jeffland!

0 Karma

gyslainlatsa
Motivator

hi shariinPH,
try use this change -1month@month by -1mon@mon and @monthby @mon

 index=rbi sourcetype=change earliest=-1mon@mon  latest=@mon|stats latest(cm_actualsched) as pmas

Nb: I using the splunk 6.2.2
try and let me know.

0 Karma

gyslainlatsa
Motivator

put earliest=0 and latest=now()

please validate my answer

gyslainlatsa
Motivator

validate the answers for gyslainlatsa

0 Karma

gyslainlatsa
Motivator

please validate my answers and not your comments

0 Karma

shariinPH
Contributor

Hi gyslainlatsa, thanks for your answer 🙂 but i want to change that months into all time . so my earliest should be the first indexed data and my latest should be the latest indexed data .. do you know how to do it?

Cheers 🙂

0 Karma

shariinPH
Contributor

@gyslainlatsa

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 Certification at ...

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 ...