Use Kapacitor to export data into various databases

We have a central InfluxDB server which receives measurements from numerous hosts in our network. We want to export measurements from specific hosts to a customer database and tag that with a customer ID. For this I tried to write a number of TICK scripts to fix this in Kapacitor. However, I can’t get the script to work: although the script loads, no data is written to the target database.

This is one of many attempts to get this to work:

dbrp "telegraf"."autogen"

        .where(lambda: ("host" =~ '/customer-hostname/'))
        .tag('customer_id', '12345')

If I try to query the Influx database, I get proper data:

> select bit_rate_download from "telegraf"."autogen".jitsi_stats where host =~ /customer-hostname/ and time > now() - 1m
name: jitsi_stats
time                 bit_rate_download
----                 -----------------
2020-07-13T09:45:39Z 0
2020-07-13T09:45:40Z 0

Any hints on what I’m doing wrong and how to get this to work would be appreciated!

Turns out I forgot to add a correct subscription entry in my kapacitor config, so no data could be received. Now that I fixed that, everything works as designed.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.