All,
I am trying to create a dashboard search to monitor if the named process is running on our name servers. I am trying to run a search on a set number of hosts, but if the hosts contain no data set the graph to red.
Here is my search:
index="os" source="top" host=ns1 OR host=ns2 OR host=ns3 OR host=ns4 named earliest=-2min latest=-1min | stats count by host | eval redCount = if(count !=1,count,0) | eval greenCount = if(count = 1,count,0) |fields - count
So basically, I'm looking in the last few minutes that the named process is showing up in the search. Then checking that there is only 1 line per host. If there is only 1 line the graph is green, if the number is not equal to one, turn red.
My issue is, what if I have a host like ns4 that is down and shows no data from the search? Then the search just shows 3 out of the 4 hosts as green.
How do I generate an error if any of the 4 hosts show no data? I am only interested in the 4 "hardcoded" hosts in my search.
... View more