Hard to say what is wrong just by looking at the script. Is Kapacitor processing the data, if so are there any errors shown when you run the above command?
Also, run journalctl -fu kapacitor | grep “your alert/script name” you will be able to see what happens when the script is run by Kapacitor.
journalctl -fu kapacitor | grep test
No journal files were found.
I agree not very helpful when it just stays enable and you can’t see it writing or running. I even changed kapacitor into debug mode nothing in the logs just http requests.
Sorry if i am teaching you to suck eggs here.
sudo tail -f /var/log/kapacitor/kapacitor.log
It looks from the output that Kapacitor is not streaming the data from the database. If the script was bad you would have errors listed next to each node in the output from teh first command. if you receieved no error messages when defining your TICK script then I’d look at the connection between the Kapacitor instance and InfluxDB.
One thing i notice in your script is you are not passing a retention policy to the |from() node.
Could you add this to your script:
var rp = ‘retention-policy-name’
Then in the |From node between the .database(‘analytics’) and .measurement(‘CLIENT_VALUES’)
.retentionPolicy(rp)
While you specify the RP when defining the script in Kapacitor, i think you may still need to explicitly set it in the script.
Agreed it can be a bit painful at times when it comes to debugging but the more you do it the easier it gets apparently (i’m not sure though )
anways,
You’ve set the RP in the script and looking at that output it is the one you need. what affect did this have?
When you created the database and RP did you specify the default RP?
If you query influxdb directly, do you see the data in your database?
When you select the database (use database-name) specify your RP to be certain.
If you haven’t already, could you check in Influx and see what RP’s are associated with the database? It could be something simple like your data is going to the autogen RP which means your script won’t see the points being processed.
A side note, I’ve seen a lot of people with scripts using the “default” RP - The issue is that RP doesn’t actually exist. Its created as “autogen” but labelled as the default in InfluxDB.
You’re config looks good it doesn’t look any different to mine. Do you use any SSL certs? self signed or CA signed?
let me check the RP thanks for the help yes interesting to debug I am pushing the data into influx from flink and then what to alter it using kapacitor