Reputation: 11
I'm trying to build a rule in Azure Stream Analytic (ASA) job with this logic: "when a value is between X and Y, and it stays in that range for 1 minute, then output to service bus (then to Azure Function to send alert). If the value is outside this range within the 1 minute window, window should be reset."
I've been reading windowing functions and it seems to me that a window starts when ASA starts, but I could be wrong.
Is there a way to start the (tumbling) window when a "bad value" event occurs and stop the window when the value turns to good (outside the range)?
Thanks!
Upvotes: 0
Views: 676
Reputation: 8491
In Azure Stream Analytics, all Window functions are defined with a fixed length. In addition, Windows functions are defined in a Job. The only way to reset the window is changing the query of the Job and restart the Job.
Is there a way to start the (tumbling) window when a "bad value" event occurs and stop the window when the value turns to good (outside the range)?
Based on your description, I think what you needed is raising event when the value is in a range for a minute.
Sliding Window is more suitable for your requirement. It will produce an output only when an event occurs.
Upvotes: 1