ifAlias Tag Filter Issue

Hey,

I’m using telegraf to collect SNMP traffic stats for interfaces on a cisco switch, in doing so I am also getting the ifDescr and ifAlias and storing them as tags in influx.

ifDescr is the name of the interface and ifAlias is the description we give interfaces on our configuration of the device. My goal is to create a graph panel which has only interfaces containing “WAN” in the ifAlias.

My configuration is this:

I have two variables in the dashboard -

First variable is named Network_Device and is configured as show tag values with key = "hostname" (this comes from also getting the device name in the snmp collection process)

Second variable is named Interface and is set as follows:

show tag values from interface64 with key = "ifAlias" where hostname =~ /($Network_Device)/

with Regex /.*WAN.*/

In the “preview of values” section I see the list of ifAlias’s containing only “WAN” which is perfect. On my dashboard these show up beautifully as filter dropdowns. I see the correct devices + interface aliases that I want.

In my query on the panel itself I have the following:

SELECT non_negative_derivative(max("ifHCInOctets"), 1s) *8 AS "Traffic In", non_negative_derivative(max("ifHCOutOctets"), 1s) *8 AS "Traffic Out" FROM "interface64" WHERE ("hostname" =~ /^$Network_Device$/ AND "ifAlias" =~ /^$Interface$/) AND $timeFilter GROUP BY time($__interval), "hostname", "ifAlias" fill(null)

This is where the issue begins, it returns no data. Now if I remove the tag filter ifAlias =~ /^$Interface$/ it displays every single interface with the interface aliases, so I know the actual tagging part is working in influx and I know the data is there. It seems to be a specific issue with using ifAlias as a tag filter in the query but I am completely lost as to why.

Any assistance would be greatly appreciated.

Thanks

So I’m seeing the same thing in Grafana v6.3.3 (commit: 84d0a71) and InfluxDB 1.7.7. Both InfluxDB and grafana are running in containers from docker hub.

This query in grafana is returning no data:

SELECT derivative(mean("ifHCInOctets"), 1s) * 8 AS "Out", derivative(mean("ifHCOutOctets"), 1s) * -8 AS "In" FROM "ifXTable" WHERE ("hostname" = 'sw-cameras' AND "ifAlias" = 'Blue Iris') AND $timeFilter GROUP BY time($interval) fill(null)

However, if I remove the ifAlias condition I do get data.

The same query (manually entering the timestamps) does return data in influx itself:

> SELECT derivative(mean("ifHCInOctets"), 1s) * 8 AS "Out", derivative(mean("ifHCOutOctets"), 1s) * -8 AS "In" FROM "ifXTable" WHERE ("hostname" = 'sw-cameras' AND "ifAlias" = 'Blue Iris') AND time > now() - 15m GROUP BY time(5m) fill(null)
name: ifXTable
time                Out               In
----                ---               --
1566174600000000000 632266.92740743   -24692001.45777669
1566174900000000000 933974.9765925598 -36541166.32355794
1566175200000000000 764653.6639999899 -30257548.543997396
1566175500000000000 613105.5875555929 -24357553.581334636

Anyone have any idea why this could be happening? Have @jarryds and I hit some really obscure bug? The only thing I can think if is that hostname is a tag and ifAlias is a field, but I’m not sure why that should make a difference on the select.

Well this is odd – If I open the query inspector, the graph suddenly populates without making any changes to the query. I will open a bug for this.