简体   繁体   English

如何避免转义自定义 Grafana 变量?

[英]How to avoid escaping custom Grafana variable?

My Grafana dashboard shows statistics for some Elastic documents.我的 Grafana 仪表板显示了一些 Elastic 文档的统计信息。 Some of these documents have the attribute important_details , some don't.其中一些文档具有属性important_details ,有些则没有。 I want to create a "Has important details: Yes/No/All" filter.我想创建一个“有重要细节:是/否/全部”过滤器。

What I did was I created a new has_important_details variable, type "Custom", with the following options:我所做的是创建了一个新的has_important_details变量,类型为“Custom”,具有以下选项:

Yes : _exists_:important_details, No : NOT _exists_:important_details

Then, I'm editing the panel and add $has_important_details to the Query field.然后,我正在编辑面板并将$has_important_details添加到 Query 字段。

This doesn't work, and the reason seems to be that instead of _exists_:important_details , it actually sends the query这不起作用,原因似乎是它实际上发送了查询而不是_exists_:important_details

_exists_\\:important_details

and likewise同样

NOT\\ _exists_\\:important_details

for the opposite.相反。

I found it out myself after all.毕竟是我自己发现的。 Instead of $has_important_details , the Query field should be ${has_important_details:raw} .而不是$has_important_details ,查询字段应该是${has_important_details:raw}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM