0

I wrote a bash script for inserting the summary of the daily energy database "xxx_d" into the monthly database "xxx_m" - triggered on every 1st day of the month at 02 o'clock by a systemd-timer. That's a pretty nice working workaround for the missing "1M" on the continuous querys of InfluxQL.

Now I've the following issue (it's an example; every entry is timestamped too early): the entry in the monthly database "xxx_m" is written on 01.04.2023 02:20 with the wrong timestamp of the first data of the daily database "xxx_d", because this is the summary of all data from 01.03.2023 00:00 to 01.04.2023 00:00, but the timestamp is 01.03.2023 00:00 !

The problem: grafana shows the bar chart at 02-2023 - WHY? So all entries are one month too early. How can I solve this? Is the only working solution to make two separate influxQL-Commands from it? First a SELECT on the daily DB and then second an INSERT on the monthly db?

Until now it is a "One-liner" like where ${ANFANG} is "2023-03-01" and ${ENDE} is "2023-04-01".

SELECT sum(*) INTO xxx_m.autogen.:MEASUREMENT 
FROM "shellies" 
WHERE time >= '${ANFANG}' AND time < '${ENDE}'

Or is it a grafana issue and I need to solve it there? How to do that?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.