简体   繁体   English

使用 Elasticsearch 数据源的 Grafana 中没有可用的指标

[英]No metrics available in Grafana with Elasticsearch data source

I created an elasticsearch datasource in Grafana connected to an index of my elasticsearch instance.我在 Grafana 中创建了一个 elasticsearch 数据源,连接到我的 elasticsearch 实例的索引。

When playing with it in Grafana Explore:在 Grafana 探索中使用它时:

I correctly see the events on the graph if I plot the Count.如果我 plot 计数,我正确地看到了图表上的事件。 But if I add an aggregation metric like min, avg, max etc, then in the text box where I'm supposed to select the event field to aggregate on, I have an empty dropdown list:但是,如果我添加一个聚合指标,如 min、avg、max 等,那么在我应该 select 的文本框中,要聚合的事件字段,我有一个空的下拉列表:

在此处输入图像描述

I tried to manually write the dotted path to the fields but it didn't work.我尝试手动将虚线路径写入字段,但它不起作用。 If I select the "Raw Data" metric type, I can see my events fields in the displayed columns:如果我 select “原始数据”度量类型,我可以在显示的列中看到我的事件字段:

在此处输入图像描述

Any idea how to make my events fields appear in the dropdown list?知道如何让我的事件字段出现在下拉列表中吗? Is it related to how index mappings are defined in elasticsearch?是否与 elasticsearch 中如何定义索引映射有关?

The documents in elasticsearch have a the following structure: 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
    ]
}

Ok that was simply related to the index mapping defined in elasticsearch for the related index.好的,这只是与在相关索引的 elasticsearch 中定义的索引映射有关。 The fields that will appear in the dropdown list are the fields that are defined in the index mapping with a compatible numeric type (like "integer").将出现在下拉列表中的字段是在索引映射中定义的具有兼容数字类型(如“整数”)的字段。

I created the grafana dashboard with elasticsearch as data source which takes data from metricbeat but, the data is not coming up in grafana.我使用 elasticsearch 作为从 metricbeat 获取数据的数据源创建了 grafana 仪表板,但是数据没有出现在 grafana 中。 I used digital ocean droplets(ubuntu 22.04) as the OS.我使用数字海洋水滴(ubuntu 22.04)作为操作系统。 Did you face this issue?你遇到过这个问题吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM