Kapacitor - average value size alerting

I am trying to configure the kapacitor to alert when a value has been equal to or above a certain value for a specific amount of time, e.g. if value equal to or above 1 for more than 5 minutes. I’ve tried configuring the window size within my TICKscript however have never consistently gotten the expected results.

Is it possible to configure kapacitor in this way?

The stateDuration node is exactly what you need here. The docs are here

Hope that helps