如何解决将字段转换为标签后,没有查询结果 系统信息:复制步骤:预期的行为:实际行为:其他信息
我正在将Telegraf与遥测一起使用,我想根据其描述“ / interfaces / interface / subinterfaces / subinterface / state / description”查看接口上的流量水平。不幸的是,接口描述是作为字段键的,我使用processors.converter对其进行了转换。由于此后我需要重写数据,因此我删除了整个测量值,以便可以进行新标记。
我确实将描述视为标记字段,并将接口描述视为标记键。
不幸的是,当我尝试通过接口描述进行查询时,在任何查询上我仍然得到空白的结果。
### Relevant telegraf.conf:
# Convert values to another metric value type
[[processors.converter]]
# Fields to convert
[processors.converter.fields]
tag = ["/interfaces/interface/subinterfaces/subinterface/state/description"]
系统信息:
Telegraf 1.14.5 Debian
复制步骤:
> select "/interfaces/interface/subinterfaces/subinterface/state/description" from "/interfaces/"
(空结果),因为现在它是一个标签,所以可以预期
> show tag keys
name: /interfaces/
tagKey
------
/interfaces/interface/subinterfaces/subinterface/state/description
我们可以在这里看到它是作为标记键
> show tag values with key = "/interfaces/interface/subinterfaces/subinterface/state/description"
(提供所有说明)
> SELECT "/interfaces/interface/subinterfaces/subinterface/state/counters/out-pkts" from /interfaces/ where "/interfaces/interface/subinterfaces/subinterface/state/description" = 'some_description'
(空结果)我希望根据界面描述获得一些结果
预期的行为:
SELECT "/interfaces/interface/subinterfaces/subinterface/state/counters/out-pkts" from /interfaces/ where "/interfaces/interface/subinterfaces/subinterface/state/description" = 'some_description'
为带有该描述的界面提供一些结果
实际行为:
SELECT "/interfaces/interface/subinterfaces/subinterface/state/counters/out-pkts" from /interfaces/ where "/interfaces/interface/subinterfaces/subinterface/state/description" = 'some_description'
(不返回任何结果)
其他信息
我也在使用Chronograph,它也没有结果。
解决方法
您不能仅从测量中选择标签。为了使大量输入返回结果,需要在select子句中至少保留一个字段。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。