Hi,
I have a pretty simple request and I’m having trouble configuring it :
All I want is to chose what will be the “fieldKey” resulting from my query
Here are the name of the FIELD KEYS I’m querying
name: cpu_load
fieldKey fieldType
-------- ---------
load_15min float
load_1min float
load_5min float
How Influx answers when I’m asking for the mean :
> select mean(*) from cpu_load GROUP BY * LIMIT 10
name: cpu_load
tags: dbname=testdb
time mean_load_15min mean_load_1min mean_load_5min
---- --------------- -------------- --------------
0 8.608403614457835 8.160240963855422 8.369216867469879
I know “AS” is supposed to help here, but I have this when I use ‘AS’
> select mean(*) AS MYNEWNAME from cpu_load GROUP BY * LIMIT 10
name: cpu_load
tags: dbname=testdb
time MYNEWNAME_load_15min MYNEWNAME_load_1min MYNEWNAME_load_5min
---- -------------------- ------------------- -------------------
0 8.515591715976335 8.070710059171601 8.275976331360946
Here is what I want :
> select mean(*) AS whatever from cpu_load GROUP BY * LIMIT 10
name: cpu_load
tags: dbname=testdb
time load_15min load_1min load_5min
---- -------------------- ------------------- -------------------
0 8.515591715976335 8.070710059171601 8.275976331360946
Basically, I want the result of my query to have the same field name as original. Why ? I am running this kind of queries to downsample from a retention policy to an other, but I want the field names to be the same so I can navigate trhough Grafana between both retention policies, and I need to have the same field names to do so.
Running Influx 1.8.2 on Debian Buster