Kapacitor batch task influxDBOut not working

Newbee question:
I wrote my first kapacitor batch task, based on examples I found on the internet. The goal is to count the number of records every minute and to write that number back into the same influx database in a different measurement.
This is the code:

batch
|query(’’‘select count(“value”) from “openhab_db”.“autogen”.PushButton where “value” = 1’’’)
.period(1m)
.every(1m)
.groupBy(time(1m), *)
.fill(0)
|influxDBOut()
.database(‘openhab_db’)
.measurement(‘OneMinRain’)

I wrote it inside chronograf, which tells me the syntax is ok.
In chronograf and in kapacitor, I see that this batch is defined and enabled.
The code does not work: It doesn’t create the new measurement OneMinRain.

In kapacitor logs, I see this type of logging:

ts=2020-12-25T11:50:45.218Z lvl=debug msg="starting next batch query" service=kapacitor task_master=main task=2nd_batch node=influxdb_out2 query="SELECT count(value) FROM openhab_db.autogen.PushButton WHERE value = 1 AND time >= '2020-12-25T11:49:45.218163825Z' AND time < '2020-12-25T11:50:45.218163825Z' GROUP BY time(1m, 0s), * fill(0)"
ts=2020-12-25T11:50:50.340Z lvl=info msg="http request" service=http host=172.18.0.11 username=- start=2020-12-25T11:50:50.333703288Z method=POST uri=/write?consistency=&db=_internal&precision=ns&rp=monitor protocol=HTTP/1.1 status=204 referer=- user-agent=InfluxDBClient request-id=6f287479-46a7-11eb-9836-000000000000 duration=6.763568ms
ts=2020-12-25T11:50:50.348Z lvl=info msg="http request" service=http host=172.18.0.11 username=- start=2020-12-25T11:50:50.333843064Z method=POST uri=/write?consistency=&db=_internal&precision=ns&rp=monitor protocol=HTTP/1.1 status=204 referer=- user-agent=InfluxDBClient request-id=6f2879ea-46a7-11eb-9837-000000000000 duration=15.038936ms

This is how far I got.

  • I don’t understand the reason for the log messages on _internal database.
  • I don’t know how I should find why my batch tickscript is not performing.

Thanks in advance for all answers.