How can I compare current value in my stream with previous value in tickscript?

489 Views Asked by At

I am working on kapacitor alerts to generate alerts on data in influxDB. I am receiving a new value from the stream when a request has been made. I want to compare the current value in my stream I received with the previous value I received just before it to see if current value is greater than previous value or not. If it is greater than previous value, then I want to generate an alert on chronograf using kapacitor and tickscript.

How do I achieve this in tickscript? Any help is highly appreciated. I am new to tickscript.

1

There are 1 best solutions below

1
On

Have you tried https://community.influxdata.com Essentially you create two streams and using offset and windows you can compare them using eval with if condition. Have you attempted writing a tickscript?