Splunk Search

Setting up earliest and latest time with relative date and fixed time

AruBhende
Explorer

I am trying to define a query where I have to use the earliest time as 2 days ago at 22:20:45 and latest time 1 day ago at 22:20:45

I tried different formats below

earliest=-2d@:22h:20m:45s

latest=-1d@d+20h+30m+45s

But - I am not sure if these are correct and also how can I check if this translates to the date and time I am trying to set.

Thank you

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

I've used similar formats before - only with a single add-on (-1@d+8h, for example) - but I think it should work.

Fix the earliest to -2d@d+22h+20m+45s 

To verify you're getting the right start and end times, add the addinfo command to your query and display the info_min_time and info_max_time fields.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

I've used similar formats before - only with a single add-on (-1@d+8h, for example) - but I think it should work.

Fix the earliest to -2d@d+22h+20m+45s 

To verify you're getting the right start and end times, add the addinfo command to your query and display the info_min_time and info_max_time fields.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...