lolix
lolix

Reputation: 1527

Kapacitor Write to file

.tick script:

stream
    |from()
        .measurement('httpjson_example')
    |alert()
        .crit(lambda: "temperature" <  70)
        // Whenever we get an alert write it to a file.
        .message('test')
        .log('/tmp/test.log')

Output test.log:

..."message":"test","CRITICAL","data":{"series":[{"name":"httpjson_example","tags":{"host":"influxdata","server":"http://...:8080/readings"},"columns":["time","dewPoint","heatIndex","humidity","response_time","temperature"],"values":[["2016-06-23T12:38:42Z",12.06,22.15,51.6,2.078549411,22.5]]}]}}

This script write to file but I just want string 'test' written.

Upvotes: 0

Views: 696

Answers (1)

Michael Desa
Michael Desa

Reputation: 4747

At the moment this isn't possible without a bit of work writing your own UDF.

If you'd like to see this feature in Kapacitor, open a feature request that details your use case.

Upvotes: 1

Related Questions