【发布时间】:2020-10-20 15:26:41
【问题描述】:
我在 Grafana 中创建了一个弹性搜索数据源,连接到我的弹性搜索实例的索引。
在 Grafana 探索中使用它时:
如果我绘制计数,我可以正确地看到图表上的事件。但是,如果我添加一个聚合指标,如 min、avg、max 等,那么在我应该选择要聚合的事件字段的文本框中,我有一个空的下拉列表:
我尝试手动将虚线路径写入字段,但没有成功。 如果我选择“原始数据”指标类型,我可以在显示的列中看到我的事件字段:
知道如何让我的事件字段出现在下拉列表中吗?是否与 elasticsearch 中如何定义索引映射有关?
elasticsearch 中的文档结构如下:
{
"_index": "events-20201020",
"_type": "_doc",
"_id": "yT1tRnUBgIoehyP27AZU",
"_score": null,
"_source": {
"summary": "A summary",
"category": "a category",
"client_id": "a-client-id",
"client_key": "a-client-key",
"hostname": "example-hostname",
"source": "xxxxxxx",
"details": {
// lot of nested fields related to the event
},
"utctimestamp": "2020-10-20T14:33:21.216573+00:00",
"type": "event",
"processname": "process name",
"severity": "severity",
// ... and some other fields
},
"sort": [
1603204401216
]
}
【问题讨论】:
标签: elasticsearch grafana