我想将 Grafana 中的模板功能与 Elasticsearch 结合使用来创建一组“动态”术语(“应用程序”)
要从我正在使用的elasticsearch 获取术语列表:
{
"aggs" :
{
"applications" : {
"terms" : { "field" : "businessTransactions.application" }
}
}
}
当我在模板查询变量设置中使用该查询时,Grafana 查询告诉我:“模板变量无法初始化:无法读取未定义的属性“then””
我使用的是grafana 3.1.0beta1
也许我完全不知道,但是有人如何使用查询从elasticsearch获取字段的不同术语作为模板变量?
谢谢!
最佳答案
第一个问题:您使用的是哪个版本的 Grafana?抱歉,刚刚重新阅读并看到了答案,即 3.1.0beta1。
以下内容适用于我的 3.1.0(非测试版)。
第二个问题:您看到这个页面了吗:http://docs.grafana.org/datasources/elasticsearch/
Templating
The Elasticsearch datasource supports two types of queries you can use to fill template variables with values.
Possible values for a field
{"find": "terms", "field": "@hostname"}
Fields filtered by type
{"find": "fields", "type": "string"}
Fields filtered by type, with filter
{"find": "fields", "type": "string", "query": <lucene query>}
Multi format / All format
关于grafana - 使用 Elastic Search 在 Grafana 中进行模板化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38040890/