Getting Data In

How to alert if the last indexed log from a host is older than 15 mins from the search time?

pbsuju
Explorer

I have a requirement where a log file from my application hosts will get updated every 15 mins if the application is healthy. But there wont be any logs updated if there is any issue with the application. So wanted an alert from each host if the last indexed log from any host is more than 15 mins old. Appreciated any thoughts on it.

0 Karma

nickhills
Ultra Champion

The easiest way is to use the metadata command

|metadata type=hosts index=*|eval threshold=now()-900|where lastTime<threshold|eval lastEvent=strftime(lastTime, "%Y-%m-%d %H:%M:%S"|table host lastEvent
If my comment helps, please give it a thumbs up!
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...