I’m trying to query data from InfluxDBv2 using Flux language. However, the data inserted to database is categorized by ‘user’ tag. So, the output data is not returned in time order value. Here is my query:
from(bucket: “pod_monitoring”)
|> range(start: -{{hours}}h)
|> filter(fn: (r) => r[“_measurement”] == “mod_app”)
|> filter(fn: (r) => r[“_field”] == “app_state”)
|> filter(fn: (r) => r[“user”] == “{{user}}”)
|> group()
|> sort(columns: [“_time”])
and here is the result:
Even if I’m using the sort() function and ungroup it using group() it didn’t keep the data in time order. Any suggestion to achieve this?