Splunk Search

Using now() in real-time

matthewcanty
Communicator

Hello everyone. I want to track in real-time the time since the last event occurred. When I do this currently the time starts out positive and correct then proceeds to become a progressively larger negative number. I know this is because now() refers to the time at which the search was started. So how do I get NOW now?

My current search is:

host="APP90*-TSDAL" FeedSource="*" 
| stats max(_time) As LatestTime
| eval Gap=round((now()-LatestTime),1)
| fields Gap

Thanks for your help.

Tags (2)
1 Solution

kallu
Communicator

You should use time() instead of now()

View solution in original post

kallu
Communicator

You should use time() instead of now()

matthewcanty
Communicator

Perfect. Thank you so much.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...