1

I have 'chunks' of data getting stored every 30 seconds. The timestamps on each row of a chunk is the same. The measurements and one of the tags are different. Is there a way to query the data so that I get the data from the last 24 hours but with timestamps of every x mins instead of 30 seconds? I don't need that fine a resolution.

bloodynri
  • 543
  • 1
  • 6
  • 14

1 Answers1

2

Use GROUP BY time interval:

GROUP BY time(xm)

but you will need to apply some aggregation function on the field, for example MEAN(field) to get average value.

Doc: https://docs.influxdata.com/influxdb/v1.6/query_language/data_exploration/#group-by-time-intervals-and-fill

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59