Query Filter on tag key with special char / and @

Dear All,

I have a strange problem on querying using FLUX some Telemetries captured by Telegraf when I want to FILTER result. This is data structure but when I want to filter using tag “/interfaces/interfaces/@name == fpx0” using integrated script editor I have an error

from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: ® => r._measurement == “/interfaces/”)
|> filter(fn: ® => r._field == “/interfaces/interface/state/counters/in-octets”)
|> filter(fn: ® => r./interfaces/interface/@name == “fxp0”)

compilation failed: loc 0:0-0:0: expected an operator between two expressions

I have also played with \ as escape key but without success.

Openconfig standards use / so i think the use of / inside tag name could increase in the next months!


Solved using

|> filter(fn: ® => r["/interfaces/interface/@name"] == “fxp0”)

and not using

|> filter(fn: ® => r./interfaces/interface/@name == “fxp0”)

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.