Splunk Search

How to make eval now() takes latest time filter?

jamin358
Explorer

I have a search that makes a decision based on time since an event. 

 

| eval diff = now() - _time

 

and then make some decision based on how long ago the event took place

 

| eval state = if(diff<300, "active", "not active")

 

However, if I want to run this historically, my diffs are set to current time so I can't easily look historically at a point in time and tell the state of the world (with the same search). 

Is there a time function in search where I can pull the earliest and latest time filters?

eg

 

| eval diff = $timerange.latest$ - _time 

 

Labels (1)
Tags (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| addinfo
| eval diff = info_max_time - _time

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| addinfo
| eval diff = info_max_time - _time
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...