You could certainly setup a lookup file for your hosts, perhaps something like this:
host_settings.csv
host,monitor,threshhold_minutes
ahost,Y,30
bhost,Y,10
hostc,N,0
Your search:
| tstats last(_time) as lastSeen where index=* by host
| append [ inputlookup host_settings.csv ]
| stats last(lastSeen) as lastSeen last(monitor) as monitor
last(threshhold_minutes) as threshhold_minutes by host
| where monitor="Y"
| eval status=case(isnull(lastSeen),"MISSING",
lastSeen >= now()-(threshhold_minutes*60),"okay",
1==1,"MISSING")
| eval lastSeen = strftime(lastSeen,"%x %X")
| table host lastSeen status threshhold_minutes
I hope this gives you a good starting point. Why am I appending instead of searching with the lookup table? For my purposes, I want to create a list of all the hosts, whether they have had data within the search time period or not. (Set your search time to approximately the longest time you want to monitor, in your example: 60 minutes.)
Why use tstats instead of metadata? tstats is very fast, almost as fast as metadata. The metadata command however, can return partial results in larger environments. So if you want better accuracy in this case, use tstats. If not, then just change the tstats to metadata and proceed...
... View more