【问题标题】:Using text field for aggregations in Elasticsearch在 Elasticsearch 中使用文本字段进行聚合
【发布时间】:2017-04-20 09:23:11
【问题描述】:

当我尝试加载可视化时,我在 Kibana 中收到以下错误。

可视化:默认情况下禁用文本字段上的字段数据。在 [beat.name] 上设置 fielddata=true 以便通过反转倒排索引将 fielddata 加载到内存中。请注意,这可能会占用大量内存。

所以我尝试添加未分析的关键字字段,并根据此LINK 启用聚合的 doc_values。

由于我正在创建每日索引,因此我创建了一个模板:

PUT /_template/template_metricbeat_1
{
    "template": "*metricbeat*",
    "order": 1,
    "settings": {
        "number_of_shards": 5,
        "number_of_replicas": 1,
        "refresh_interval": "30s"
    },
    "mappings": {
        "metricsets": {
            "properties": {
                "beat.name": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword"
                        }
                    }
                }
            }
        }
    }
}

但我有大约 50 个文本字段可用于创建可视化。

所以我的问题是如何一次性将未分析的关键字字段与我所有的 50 个文本字段一起添加?

【问题讨论】:

标签: elasticsearch kibana


【解决方案1】:

一般来说,使用 Beats 的正确方法是使用它们自己的索引模板,其中每个模板都有其特定的字段和配置。

专门针对 Metricbeat,模板在这里:https://github.com/elastic/beats/blob/v5.3.0/metricbeat/metricbeat.template.json

关于如何获取和应用它的文档在这里:https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-template.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多