Query with concatenation of tags

I have two tags in my measurement ifAlias and ifName, and due to how Grafana works with variables to be part of the title of the chart, I find myself in need to do the following:

SELECT ifAlias+" "+ifName as interface_description, ifHCInOctets, ifHCOutOctets FROM telegraf_networking WHERE time >= now() -12h

The problem is that I cant’ seem to find how to contatenate the 2 tags - it claims that tags are not strings.

Any help is appreciated.

Hello @shija03,
I just want to verify that I am understanding you correctly? You just want the tag names to be part of the chart title?
That feels like more of a Grafana question?
I’m not sure I understand, can you help clarify?
Thank you,

Hello @Anaisdg - let me clarify - yes, it would be ideal for Grafana to be able to accomplish such, but it is not possible, because Grafana can only work with what it is given, and the way that the UI structures things when it outputs them, it makes it impossible to accomplish the apparently simple requirement that I have in mind.

Consider I have a measurement with 3 tags: name, description, alias - when it comes to grafana charting, the title can only assigned the variable that it is associated with the repeat charts… hence my repeat chart titles would only be able to do: either name, alias, or description - the issue with my data is that sometimes there are descriptions and sometimes there aren’t, and sometimes they are the same for different entries - here is an example:

name      description                            alias
eth0      Internet connection                    Eth.0
eth1                                             Eth.1
eth2                                             Eth.2
eth4      Tunnel to NY                           Eth.4
po1       Internet connection                    Po.1

When I make Grafana charts using the repeat function, I have to make them by alias (or name), but obviously I want my chart to display a title other than eth1 or Eth.1. As you can see not every interface will come with descriptions and not all descriptions are unique (Before anyone says: update the descriptions, there are 10s of thousands of interfaces - managed by different companies, so I can’t tell people how to run things… they don’t get paid by me). As you can see - I can not choose only description either, since some charts have common descriptions: empty or same value.

So the ideal scenario is to be able to concatenate tags same as in SQL I can concatenate fields (column values) - Yeah, I know, I know, this is not darn SQL - it just looks like it… (Hence Flux is a totally different syntax approach)


SELECT name+description, sum(IfHCInOctets) from bandwidth GROUP by name+description+sum

On Influxdb


So now, any ideas how to go about it?

Thank you,