Open gkpraveen1988 opened 8 years ago
@gkpraveen1988 Does your drive_info
measurement have a duration
field? Or are you expecting duration
to be the duration of the alert?
Hi Nathan, Thanks for your response. Measurement = drive_info Database = asgbackup Retentionpolicy = autogen
target = tag bytes, duration, files = fields
Also, tried some thing of the below. this is not alerting in slack channel.
var last_value = batch |query(''' select target as last_target,bytes from "asgbackup"."autogen"."drive_info" LIMIT 1 ''') .period(30d) .every(5s)
var last_24h_stddev = batch |query(''' SELECT stddev("duration") AS durationstd FROM "asgbackup"."autogen"."drive_info" WHERE target='Mysqltest8' ''') .period(30d) .every(5s) .groupBy('target')
last_value |join(last_24h_stddev) .as('target_val', 'stddev')
|eval(lambda: "target_val.last_target", lambda: "stddev.durationstd")
.as('tgt_val', 'std_dev')
|alert()
.message('Last value: {{ index .Fields "tgt_val" }}, Last deviation: {{ index .Fields "std_dev" }}')
.crit(lambda: TRUE)
.slack()
.log('/var/tmp/kapacitor/files.log')
All I need is to print the values of 1st and 2nd query in the slack using a join condition. This is not happening. Please help.
Add .align()
to your batch queries. This will ensure they have matching times when they go to be joined.
Hi All,
Wrote the below tick scripts to print the field "Duration" in the slack channel for the condition of "target". However, the below seems to be not giving any alerts in the slack channel
Could you please help in what might be wrong..