使用Logstash创建ES映射模版并进行数据默认的动态映射规则
本文配置为 ELK 即(Elasticsearch、Logstash、Kibana)5.5.1。 Elasticsearch 能够自动检测字段的类型并进行映射,例如引号内的字段映射为 String,不带引号的映射为数字,日期格式的映射为日期等等,这个机制方便了我们快速上手 ELK,但是后期我们经常需要对一些特定的字段进行定制,之前本人有一篇文章进行这方面的尝试Logstash中如何处理到ElasticSearch的数据映射,但对于默认映射规则没有介绍,本文就来探讨一些默认的动态映射规则。 开始之前 先拿一个 logstash 的配置文件来看一下 output { elasticsearch { hosts => “localhost:9200" index => "my_index" template => "/data1/cloud/logstash-5.5.1/filebeat-template.json" template_name => "my_index" template_overwrite => true } stdout { codec =...