Getting Data In

How to set up an alert on all search heads if any universal forwarder has not sent data for a certain amount of time?

brod_geico
Path Finder

I need to setup an alert on all search heads if any universal forwarder has not sent data in last 6 or 4 hours. The alerts have to trigger and send an email with output of missing hosts.
I have tried to use this one but it is not working.
|metadata type=hosts index=*| table host lastTime | where lastTimerelative_time(now(),"-30d@d")
| convert timeformat="%Y%m%d" ctime(lastTime) AS LastTime

0 Karma

lguinn2
Legend

Well, the reason could be that the where command is looking for a "last time" of over 30 days ago - and you have a typo.

Try this

|metadata type=hosts index=*
| table host lastTime
| where lastTime < relative_time(now(),"-4h")
| eval lastTime = strftime(lastTime, "%x %X")
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...