Kapacitor stream replay with mutlple measurements




In an electric network I want to calculate the difference between in-flow and out-flow of energy using kapacitor.
Imagine A is a energy source and B and C are sinks, the difference D is A-(B+C). As only A,B and C are measured every minute I wrote the following TICK script to store D in a database:

dbrp "sensors_raw"."autogen"

var A = stream
    | from()
    | httpOut('A')

var B = stream
    | from()
    | httpOut('B')

var C = stream
    | from()
    | httpOut('C')

    | join(B,C)
        .as('sensor_A', 'sensor_B', 'sensor_C')
    | eval(lambda: "sensor_A.W" - ("sensor_B.W" + "sensor_C.W"))
    | httpOut('D')

To test the TICK script above I tried to do
kapacitor replay-live query -task "test" -rec-time -query 'select * from "sensors_raw"."autogen"."A","sensors_raw"."autogen"."B","sensors_raw"."autogen"."C" where time > '2018-03-02T09:49:00Z''
failing with
running replay: could not determine database and retention policy. Is the query fully qualified?

Executing exactly same query in influx returns the data as expected. What is going on there and how can I test the script with historic data?

Btw: Any ideas on improving the script etc are welcomeā€¦


This text will be hidden