ELK Stack - 自定义自动生成的字段映射

ELK Stack - Customize autogenerated field mappings

我有一个非常基本的 ELK 堆栈设置并通过系统日志将日志传递给它。我使用内置的 grok 模式将日志拆分为字段。但是字段映射是由 logstash elasticsearch 插件自动生成的,我无法自定义它们。

例如,我使用 logstash 配置文件(见下文)创建了一个名为 "dst-geoip" 的新字段:

geoip {
  database => "/usr/local/share/GeoIP/GeoLiteCity.dat" ### Change me to location of GeoLiteCity.dat file
    source => "dst_ip"
    target => "dst_geoip"
    fields => [ "ip", "country_code2", "country_name", "latitude", "longitude","location" ]
    add_field => [ "coordinates", "%{[dst_geoip][latitude]},%{[geoip][longitude]}" ]
    add_field => [ "dst_country", "%{[dst_geoip][country_code2]}"]
    add_field => [ "flow_dir", "outbound" ]
}

我想给它分配我无法从 Kibana 编辑的类型 "geo_point"。在线文档提到使用 ElasticSearch API 手动更新相应索引的映射。但是 Logstash 会生成很多索引(每天一个)。如果我更新一个索引,映射在未来的索引中会保持不变吗?

您要查找的是“template”。