InfluxDB different results with different time ranges

155 Views Asked by At

Due to a wrong retention setting I’ve lost a whole month of data (November 2022). As I have the data in another system, I’ve used the “Load Data” → “Line Protocol” → “Write Data” functionality in order to write the lost data points back into the database starting on the 6th of November. The original data thats left (everything after the lost month) starts at the 9th of December 2022.

Now, when I query the data points with the Data Explorer and I select the date range from 01.11.2022 to todays date (20.01.2023) I only see the newly written/added datapoints that got lost before.

enter image description here

When I execute the same query, but instead of a custom time range, I set past 30d, I do see the data from the 21st December until today.

enter image description here

The Request stays always the same. The result changes as soon as I use the Time Range selector/button.

from(bucket: "XX")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "XXXXXXXXXX")
  |> filter(fn: (r) => r["_field"] == "pvpowerout")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> yield(name: "mean")

How come, that with one time range I see the original data and with another time range i only see the manually added data points?

Maybe my line protocol is wrong?!

XXXXXXXXXX pvenergytoday=1.3 1669459511

_measurement is XXXXXXXXXX
_field is pvenergytoday
_field value is 1.3
unix timestamp is 1669459511 (set as precision seconds)

0

There are 0 best solutions below