利用 logstash 从 database 同步数据到 es 发现少了一条文档,查看日志发现是这样的错误:
[WARN][logstash.outputs.elasticsearch]: [some_field] cannot be changed from type [float] to [long]
在pipeline的配置文件中添加filter:
filter { mutate { convert => { "fieldname" => "float" } } }
可能还有更好的方法
https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-convert