[SOLVED] Influxdb query doesn't merge series

influxql

#1

Hi,

i have tried to Summarize the RAM of different maschines (Compute01 and Compute02) and according to the Docs (https://docs.influxdata.com/influxdb/v1.5/query_language/data_exploration/#merge-behavior) it should automatically calculate the Summary.

SELECT last("total") FROM "monitor"."autogen"."mem" WHERE time > now() - 24h AND ("host"='compute01' OR "host"='compute02') GROUP BY time(1m) FILL(null)

But when i take a look on the Output, it seems that influx is just grabbing the highest of both values and displays that.

Does anyone have an idea where i missed something?

Thanks
Pecadis


#2

Nested Queries is the solution:

Select sum(usage) AS "Usage", sum(total) as "Total" From (SELECT last("total") - last("free") AS "usage", 
last("total") AS "total" FROM "monitor"."autogen"."mem" WHERE time >= now() - 30m AND 
("host"='compute01' OR "host"='compute02') GROUP by host)GROUP BY time(1m) fill(null)