Use hostname as Display name

Hello all,
I am using the Zabbix data source. I am using this Zabbix data for the bar chart, and I am using multiple queries to build multiple bars on the chart. Unfortunately, I am unable to change the display name for the different bars

as we can see in the image display name is aggregateBy(1d, avg)
i want to change with its host name which i have selected.

Can you display the output here in table format (.csv if possible)? Have you tried working through the different transformations that Grafana offers? Sometimes you need to ‘stack’ several in order to achieve your desired result.

Well, when things are “Working as Intended” there’s some global variables for it, you should add a Function of setAlias() and add the $__zbx_host_name to it. It’ll be setAlias($__zbx_host_name) after your function of aggregateBy(1d, avg)

Normally it should work as bellow:

But it seems that’s some bug is happening, since when using other functions, the global variable turns into a pure string:

I just filled a bug for you, let’s see if the developers fix it for us: Global plug-in variables ("$__zbx") stop working when using more than one Function · Issue #1885 · grafana/grafana-zabbix · GitHub

More information on the options for naming btw, look for “Alias” under Functions - Grafana-Zabbix Documentation

Hello

i have data like this :

i have data like this.

Hello,
Data in csv format is :slight_smile:
image

yes i have try but that things are not working.
Like :

but this is not working.
because i have multiple query’s. if i change this, this it is apply to all.

Please, try to focus a little more… I’ll try to summarize what I said on the other post:

1 - When you use Zabbix’s Plugin Functions like aggregateBy() it substitutes the default Item Metric name
2 - The Zabbix Plugin’s Functions provides the $__zbx_host_name to be used on setAlias() function to correct the change from other Functions
3 - The provided solution from Zabbix Plugin’s Functions seems to be bugged, and a Bug Report was already filled

I don’t see any other ways to help in your case, since the “right answer” is clouded by a Software Bug.