【问题标题】:Kapacitor Write to file电容器写入文件
【发布时间】:2023-03-31 22:59:01
【问题描述】:

.tick 脚本:

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')

输出 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]]}]}}

此脚本写入文件,但我只想写入字符串“测试”。

【问题讨论】:

  • 请写一个明确的问题

标签: influxdb kapacitor


【解决方案1】:

目前,如果不写一些自己的 UDF 工作,这是不可能的。

如果您想在 Kapacitor 中看到此功能,请打开feature request,详细说明您的用例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-13
    • 1970-01-01
    • 2016-06-12
    • 1970-01-01
    • 2016-09-28
    • 2012-05-18
    • 1970-01-01
    相关资源
    最近更新 更多