Splunk Search

Set the time range picker in my query?

jgarr16
Explorer

Is it possible to set the time range picker (the one to the right of the search bar) as part of the query I enter in the search bar?

0 Karma
1 Solution

spitchika
Path Finder

You can append earliest and latest tags to your query like below.

index=* earliest=08/15/2020:17:0:0 latest=08/15/2020:18:0:0

  

View solution in original post

0 Karma

spitchika
Path Finder

You can append earliest and latest tags to your query like below.

index=* earliest=08/15/2020:17:0:0 latest=08/15/2020:18:0:0

  

0 Karma

jgarr16
Explorer

Thanks @spitchika 

I have tried setting the earliest & latest variables (e.g., earliest=1 latest=now()), but this only seems to work on events that fall within the bounds of the time range picker. Meaning, if I have my time range picker set for 'the last 30 days', then the earliest and latest will only return events that fall within both the "Last 30 days" and whatever boundaries are established as earliest/latest. 

At least that's how I've read it in the docs, and what the returned events I've seen seem to indicate. 

splunk_time_range_picker.png

So, in the case of this query, the earliest possible event can be no more than 30 days ago. 

What I'd like to do is enter a variable in my query that effectively changes the "Last 30 days" to "All time". I'm being lazy and trying to avoid mousing over to the drop down, selecting "All time" and clicking the green button while I'm there...

0 Karma

to4kawa
Ultra Champion

look your display. already time picker is changed.

 

19,235 events(12/31/69 4:00:01.000 PM to

spitchika
Path Finder

Atleast same query working for me... I selected last 15 mins on 8/15 but I gave time in 8/14 and I still get results.

spitchika_0-1597530118470.png

 

0 Karma

jgarr16
Explorer

My bad @spitchika, you are absolutely correct. It doesn't change what's displayed in the time range picker, but the results when using earliest/latest are all inclusive. Thanks.

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!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...