How to create an alert that is 5% of the Max value in a time range


Does anybody know if its possible to create an alert to be triggered if the current value in an InfluxDB time series is below 5% of the maximum value within the last 24 hours

I’ve tried a few things out and failing badly


I’m not familiar with the configuration of alerts, but I can give an example of
a query which gives a result under the conditions you asked for - maybe that

select last from (select last(RTT),max(RTT) from mqtt_consumer where
Dir=‘outbound’ and time>now()-24h) where last<max/20

If the last value is less than 5% of the maximum in the past 24 hours, you get
the last value.

If it isn’t, you get nothing.

Maybe that helps you create an alert?


1 Like

Thanks Antony, I will give your approach ago. Thanks for taking the time to reply :slight_smile: