使用elasticsearch数据源的grafana中没有可用的指标

4sup72z8  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(1)|浏览(480)

我在grafana中创建了一个elasticsearch数据源,连接到elasticsearch示例的索引。
在grafana中使用时,请探索:
如果我绘制计数,我就能正确地看到图表上的事件。但是,如果我添加一个聚合度量,如min、avg、max等,那么在我应该选择要聚合的事件字段的文本框中,我有一个空的下拉列表:

我试图手动将虚线路径写入字段,但没有成功。如果我选择“原始数据”度量类型,我可以在显示的列中看到我的事件字段:

知道如何让我的事件字段出现在下拉列表中吗?它与elasticsearch中如何定义索引Map有关吗?
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
    ]
}
laximzn5

laximzn51#

好的,这只是与elasticsearch中定义的索引Map有关。将出现在下拉列表中的字段是在索引Map中使用兼容的数字类型(如“整数”)定义的字段。

相关问题