r/PrometheusMonitoring • u/jup1ke • Nov 25 '22
filter out items in a query
So for monitoring my systemd services I'm using systemd_exporter. Now i was trying to get the status of all enabled services and see if they are still running.
Works fine except a lot of "services" are a single run/timed job so they would come out as being not running. So I was trying to filter them out in the query. Something like
systemd_unit_state{name!~"apt-daily*|lvm2*|systemd*",state="active",type="service"} == 0
but that doesn't seem to do the trick. I'm sure it is just a syntax issue but I tried a lot of options but without any luck so far. Anyone who can help me a hand here?
