【问题标题】:No metrics available in Grafana with Elasticsearch data source使用 Elasticsearch 数据源的 Grafana 中没有可用的指标
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-21
      • 1970-01-01
      • 2018-05-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多