Alert in kapacitor

I would like to receive an alarm using kapacitor when a different data is entered from the existing tag key.

For example

time , A(Tag key), B(Field key)
00-00-00, 1, ,1
00-00-01, 1, ,1
00-00-02, 2, ,1 <- alert
00-00-03, 2, ,1
00-00-04, 3, ,1 <- alert

I can’t do it.

Thank you for teaching.

I’ll wait.

I found a solution.

Below is an example.

stream
|from()
.database(‘test’)
.retentionPolicy(‘autogen’)
.measurement(‘test1’)
.groupBy(*)
|where(lambda: count() > 1)
|alert()
.crit(lambda: “A” != ‘0’)
.stateChangesOnly()
.log(‘C:\123123.log’)