Summing up the current value of multiple measurements of Influx

I have an influx database some_db with multiple measurements measurement1, measurement2 that contain timeseries data. I want to query the sum of the most recent value of each of these.

I’ve attempted this query

> SELECT last("value") FROM "measurement1"+last("value") FROM "measurement2" fill(previous)

but get this error:

ERR: error parsing query: found +, expected ; at line 1, char 54

Sounds like your data could be better shaped into 1 measurement with proper use of tags.
If limited to working with your data as is, try individual queries for each measurement and then a transformation to reduce down to sum.
Otherwise read up on flux for ultimate control of your own destiny :grinning:

1 Like