Where is the ALIAS for flux queries please?

For influxdb 1.x and influxql one could provide an alias to give time series a name in the legend.

Grafana_Influx1X_ALIAS

For influxdb 2.x and flux I could not find any similar.

How can I give each series a name of my choice please or get only certain parts of the default description?

E.g. I only want to show cpu-total, cpu0 and cpu1 instead of the whole usage_system {cpu=…

1 Like

Hi,

is nobody available who can help here?
Still need help please.

Hi,

Did you try to use tags ?

Good Luck

Hi wlargou,

thanks - I’m glad to get some help here.

Are you sure tags will work together with influxdb 2.0 flux queries?
I do not know what tags are and how to use them.
Even google did not really help.
Could you give me some hints to get started with tags so I can give it a try?

Hi,

Alias patterns

  • $m = replaced with measurement name
  • $measurement = replaced with measurement name
  • $col = replaced with column name
  • $tag_exampletag = replaced with the value of the exampletag tag. The syntax is $tag_yourTagName (must start with $tag_ ). To use your tag as an alias in the ALIAS BY field then the tag must be used to group by in the query.
  • You can also use [[tag_hostname]] pattern replacement syntax. For example, in the ALIAS BY field using this text Host: [[tag_hostname]] would substitute in the hostname tag value for each legend value and an example legend value would be: Host: server1 .

Source : InfluxDB | Grafana Labs

It’s a bit tricky though.

Good Luck

Hi,

sorry for replying so lately - but I am quite busy now.
Thanks - I ill try that.

But I can’t beleive taht it is much more complicated compared to influxql.

This topic was automatically closed after 365 days. New replies are no longer allowed.