Replay and backfill with Kapacitor

Hi
I’m trying to run a kapacitor batch task with a replay against historical data. The task calculates average and stores it in a measurement in the same InfluxDB database (different retention policy)

The task is supposed to calculate avg (and max) on a 24 h interval, while I get it to run it seems that even if I run if for say the past 3 days it only writes the output for the last day?

My script:
batch
|query(‘SELECT mean(value) as avg,max(value) FROM performance.autogen.cpu_usage’)
.period(24h)
.every(24h)
.groupBy(*)
|influxDBOut()
.database(‘performance’)
.retentionPolicy(‘agg_24h’)
.measurement(‘cpu_usage’)
.precision(‘s’)

And I’ve run it like this (after defining the task)
kapacitor record batch -task cpu24 -past 3d
kapacitor replay -task cpu24 -rec-time -recording

I’ve also tried the replay-live functionality
kapacitor replay-live batch -task cpu24 -rec-time -past 3d

The data it runs against is cpu metrics for around 4000 instances (VMs) and they have all metrics on 20 second intervals

Any idea as to why the replay only writes the avg for the last day (for each VM)?

Ok, so it seems that you’ll have to run the task for each time window (24 h in my case). Can anyone confirm that?

I’ve tried to specify -start and -stop with datetimes in the record command, but then I won’t get any data. From the docs.influxdata.com examples you should be able to run -start yyyy-MM-dd -stop yyyy-MM-dd , but when I do that I get this message:
parsing time “2017-11-18” as “2006-01-02T15:04:05.999999999Z07:00”: cannot parse “” as “T”

I’ve also tried with -start 2017-11-18T00:00:00Z -stop 2017-11-19T00:00:00Z , this way I get no error messages but it produces no data…

Hi, did you find a solution for this?

It works with -past 3d but not when you enter -start -stop, no error mess but no data

My mistake. The syntax works fine. I had no data in database.