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!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...