Created
March 15, 2019 18:32
-
-
Save shantanoo-desai/f2fc858bfe7cd8e0d0e697fb627201d6 to your computer and use it in GitHub Desktop.
TICK Scripts for Kapacitor v1.5. Log critical alerts in a file + store updated data in Database + send data to HTTP Endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = batch | |
|query('SELECT * FROM "telegraf_test"."autogen"."humid"') | |
.period(20s) | |
.every(20s) | |
data | |
@hash() | |
.field('v') | |
|alert() | |
.crit(lambda: TRUE) | |
.log('C:\\Users\\<user>\\Dev\\kapacitor-1.5.2-1\\udf_alert.log') | |
|InfluxDBOut() | |
.database('test_udf') | |
.retentionPolicy('autogen') | |
.measurement('hash') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = batch | |
|query('SELECT * FROM "telegraf_test"."autogen"."humid"') | |
.period(20s) | |
.every(20s) | |
data | |
@hash() | |
.field('v') | |
|httpPost() | |
.endpoint('kap') | |
|InfluxDBOut() | |
.database('test_udf') | |
.retentionPolicy('autogen') | |
.measurement('hash') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment