I am very new to influxdb and I am using it to monitor power use in watts, every 10 seconds I get a reading and to save space in the bucket I would like to only keep 7 days of 10 second data and after 7 days keep a daily total (I assume mean * 24 would give me a reasonable daily total), save this to a bucket and delete from main bucket, same for weekly/monthly.
I have been able to get the mean but can’t seem to work out how to multiply it by 24 (I am sure it’s simple but can’t seem to work out how to do it).
This is the query I have at the moment: (I may be way of track!)
from(bucket: "power") |> range(start: -1d) |> filter(fn: (r) => r["_measurement"] == "supply") |> filter(fn: (r) => r["_field"] == "value") |> aggregateWindow(every: 1d, fn: mean, createEmpty: false) |> yield(name: "mean")
Any help would be appreciated.