Score:0

InfluxDB influxQL v1.8 : Wrong timestamp used for writing to database

bz flag

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?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.