Description
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
- using telegraf and the jti_openconfig plugin, retrieve some metrics from a juniper device
- attempt to select some data points by filtering on the /interfaces/interface/@name tag
A couple significant sample queries that should show the issue:
This gives no results:
from(bucket: "jti_metrics_2")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "/interfaces/interface/state/counters_jti")
|> filter(fn: (r) => r["/interfaces/interface/@name"] == "em1")
This works:
import "influxdata/influxdb/schema"
schema.measurementTagValues(bucket: "jti_metrics_2",measurement: "/interfaces/interface/state/counters_jti",tag: "/interfaces/interface/@name")
|> filter(fn: (r) => r["_value"] == "em1")
So: Tag value seems to be indeed “em1”, but using this string in a filter doesn’t find any lines. Removing the filter on the interface name tag show data lines. It seems to be the same thing for all tag names that contain an “@” symbol, but the symbol in itself isn’t the issue. More importantly, using a preprocessor in telegraf to rename the tag actually works.
Sample preprocessor configuration:
[[processors.rename]]
namepass = ["/interfaces/interface/subinterfaces/subinterface/state/counters/_jti"]
[[processors.rename.replace]]
tag = "/interfaces/interface/@name"
dest = "interface_name"
Expected behavior:
Results are returned
Actual behavior:
No results are returned
Environment info:
- System info: Linux 5.15.0-58-generic x86_64
- InfluxDB version: Influx CLI 2.6.1 (git: 61c5b4d) build_date: 2022-12-29T15:41:09Z