Splunk Search

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


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?



| eval diff = $timerange.latest$ - _time 


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

| addinfo
| eval diff = info_max_time - _time

View solution in original post

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

Devesh Logendran, Splunk, and the Singapore Cyber Conquest

At this year’s Splunk University, I had the privilege of chatting with Devesh Logendran, one of the winners in ...

There's No Place Like Chrome and the Splunk Platform

WATCH NOW!Malware. Risky Extensions. Data Exfiltration. End-users are increasingly reliant on browsers to ...

Customer Experience | Join the Customer Advisory Board!

Are you ready to take your Splunk journey to the next level? &#x1f680; We invite you to join our elite squad ...