I’m trying to get my query to return a count of breaches of a threshold for the memory usage on a set of server.
Unfortunately, i’m not quite being able to figure out that’s possible. The current query I have returns the max memory usage for the given hosts. How would I go about adding a count() feature to this?
timeseries usage=max(dt.host.memory.usage), by:{host.name}, interval:1h
| filter host.name == “host1” OR host.name == “host2” OR host.name == “host3” OR host.name == “host4”
You can use iterative expression to compare each value of returned timeseries against threshold and put in breaches table 1 when it is crossed (otherwise 0). By summing elements of breaches table you get count of hours where memory usage was above certain level at least once: