Need help to replace variables in from clause

Hi,

I have created two variable
suppose variable dc=DRWP_DEV_C121 & host=wp121

i want to repalce those variables in from clause ie in measurement name

i have tried many things in data query but not getting work. between two variables there is spacial character “_”

when i tried below the host is getting repaced but dc was not … getting result ==> wp121.jvm.daemon_thread_count

SELECT mean(“value”) FROM “/$dc”_"$host.jvm.daemon_thread_count" WHERE $timeFilter GROUP BY time($__interval) fill(null)

then i tried below also … this is also not getting work

SELECT mean(“value”) FROM “{$dc}_{$host}.jvm.daemon_thread_count” WHERE $timeFilter GROUP BY time($__interval) fill(null)

my final expectation is data query should return — > DRWP_DEV_C121_wp121.jvm.daemon_thread_count

Can anyone help me here, how should i write data query.

Hi,

I was able to reproduce your problem. But I found a solution using a mix with the other variable reference format, i.e.

SELECT mean(“value”) 
FROM "/[[dc]]_$host.jvm.daemon_thread_count" 
WHERE $timeFilter 
GROUP BY time($__interval) fill(null)

Marcus

yes, it’s works, Thanks Marcus.