While querying in Splunk, we have the Time range selection drop-down on the right-hand side.
When selecting the range If find myself copying and pasting 4 times usually.
I have to do this several times daily - I find it super annoying!
My question(s):
A different approach is to ignore the date range selector and use Date range queries.
The following can be added to a query.
earliest="10/15/2019:20:00:00" latest="10/22/2019:20:00:00"
See the documentation for more information.
To search for data from now and go back in time 5 minutes
earliest=-5m.
To search for data between 2 and 4 hours ago
earliest=-4h latest=-2h.
To search for data using an exact date range, such as from October 15 at 8 PM to October 22 at 8 PM
timeformat %m/%d/%Y:%H:%M:%S
Or with specify dates like
earliest="10/15/2019:20:00:00" latest="10/22/2019:20:00:00"
To search for data from the beginning of today (12 AM or midnight)
use earliest=@d
The @ symbol is referred to as the snap to and d is the time unit.
Finally, To search for data from the beginning of today (12 AM or midnight) and apply a time offset of -2h
earliest=@d-2h