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?

Labels (1)
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
Get Updates on the Splunk Community!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...