30 Aug 2024 03:53 PM - last edited on 02 Sep 2024 12:43 PM by MaciejNeumann
hi all,
when using a list of variables with CSV option that references hypervisors and ESXI host tags, i get this error on DQL query:
--A string like "xxxx" isn't allowed here. Please check the autocomplete suggestions before the error for alternative options.
i've tried 2 ways of doing this, the first one launched the error mentiones above:
the second atempt shows he cpu comsuption by cluster which is the needed metric but i cant select by variable, how can i do that'
timeseries usage = avg(dt.cloud.vmware.hypervisor.cpu.usage), by: { dt.entity.hypervisor },
filter: { in(dt.entity.hypervisor, classicEntitySelector("type(hypervisor), tag(\"vmware:PrXXXXXXX\") ")) }
| fieldsAdd entityName(dt.entity.hypervisor), usage = arrayAvg(usage)
| sort usage desc
thank you in advance 🙂
30 Aug 2024 09:43 PM
Using native DQL syntax it can be achieved this way....
I defined variable to match my demo data:
and DQL query taking this variable as input to filtering by tag looks like this:
fetch dt.entity.hypervisor
| fieldsAdd tags
| filter iAny( tags[] == concat("SYNCED_AIT:",$Cluster))
It is also possible to use concat() function together with classicEntitySelector():
fetch dt.entity.hypervisor
| fieldsAdd tags
| filter in(id, classicEntitySelector(concat("type(hypervisor), tag(\"SYNCED_AIT:",$Cluster,"\")")))