【发布时间】:2019-03-05 12:23:26
【问题描述】:
我有一个刻度脚本,我必须在多个 interface_name 上使用 where 子句运行查询,看起来像这样:
query('''SELECT last("state") as "value" FROM router.autogen.cisco_router where type = 'interface' and host = '10.66.14.82' and ("name"='GigabitEthernet0/0/0' OR "name"='GigabitEthernet0/0/1') ''')
这个查询在 influx db 上运行,但是 kapacitor 把这个查询改成这样:
`SELECT last("state") as "value" FROM router.autogen.cisco_router where type = 'interface' and host = '10.66.14.82' and (\"name\"='GigabitEthernet0/0/0' OR \"name\"='GigabitEthernet0/0/1')`
如何在刻度脚本中避免 \ 之前的 "。
【问题讨论】:
-
name是标签吗? -
是的,我在创建新标签名称 interface_name 后能够解决问题