I am wondering if during tickscript development, there is any opportunity to dump the stream state after passing through the processing node (log to the file, stdout)?
I am able to dump data from within a tick script into a separate database...
stream
|from()
.database('telegraf')
.measurement('cpu')
.groupBy(*)
.where(lambda: "cpu" == 'cpu-total')
|eval( lambda: 100.0 - "usage_idle" )
.as('usage_util')
.keep()
.quiet()
|InfluxDBOut()
.create()
.database('debugging')
Then I use Chronograf explorer to view the results...
I found it useful putting |httpOut('id')
for debugging purposes. Later you can access http://kapacitor-host:9092/kapacitor/v1/tasks/<task_id>/<httpOut_id>
and see what data is passing through that node.
Kapacitor has a Log Node that allows you to dump the stream state to the Kapacitor log files.
In use, it would look something like the following:
stream.from()...
|window()
.period(10s)
.every(10s)
|log()
|count('value')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With