Grafana中没有提供带有Elasticsearch数据源的指标

时间:2020-10-20 15:26:41

标签: elasticsearch grafana

我在Grafana中创建了一个Elasticsearch数据源,该数据源连接到我的Elasticsearch实例的索引。

在Grafana Explore中玩时:

如果我绘制Count,我可以在图形上正确看到事件。但是,如果我添加了诸如最小值,平均值,最大值等的聚合指标,那么在应该选择要对其进行聚合的事件字段的文本框中,我有一个空的下拉列表:

enter image description here

我试图手动将虚线路径写入字段,但是它不起作用。 如果选择“原始数据”指标类型,则可以在显示的列中看到我的事件字段:

enter image description here

任何想法如何使我的事件字段显示在下拉列表中?它与在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
    ]
}

1 个答案:

答案 0 :(得分:0)

好吧,它与弹性搜索中为相关索引定义的索引映射简单相关。下拉列表中将显示的字段是在索引映射中使用兼容的数字类型(例如“整数”)定义的字段。

相关问题