Quantcast
Channel: InfluxDB - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 199

Get count of days where value is greater than zero

$
0
0

Hello everyone,

I record in a Grafana database how many updates are not installed on our servers.

I would now like to know in a period of e.g. 30 days on how many days the value was not 0.

I already have a query which gives me a value for each day.
SELECT max("value") FROM "Invoke-IcingaCheckUpdates" WHERE ("hostname"::tag =~ /^$hostname$/ AND "metric"::tag = 'security::ifw_updates::count' AND value > 0 AND time > now() - 30d) GROUP BY time(1d)

I then get the following table:

However, I now lack the idea of how I can count the days, does anyone of you have an idea?

Regards
Marco

6 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 199

Trending Articles