Search code examples
jqueryinfluxdb

Show tags in header InfluxDB query


I have the following query on InfluxDB.

SELECT MEAN(value) FROM cpu_value WHERE time >="2015-11-10T15:08:30.608Z" GROUP BY type,type_instance

The query gives an output with time and mean as headers. Is it possible to show type and type_instance in the header too?

time | mean

I'd like to have such an output:

time | mean | type | type_instance

Thanks.


Solution

  • Did you mean to run:

    SELECT MEAN(value), type, type_instance FROM cpu_value WHERE time >="2015-11-10T15:08:30.608Z" GROUP BY type,type_instance
    

    Note the , type, type_instance in the select clause as well. Given you are grouping by type, type_instance .. you can just add them in select as well.