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!

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 ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...