kevwan / go-stash

go-stash is a high performance, free and open source server-side data processing pipeline that ingests data from Kafka, processes it, and then sends it to ElasticSearch.
https://go-zero.dev
MIT License
1.11k stars 145 forks source link

update writer.go to support es8.x #43

Closed wzlove closed 9 months ago

wzlove commented 9 months ago

因为es8.x去掉了_type字段,因此在写es的时候 不能再设置type 值。

wzlove commented 9 months ago
image

来解决下列报错

{"@timestamp":"2024-01-30T15:02:37.316+08:00","caller":"es/writer.go:64","content":"elastic: Error 400 (Bad Request): Action/metadata line [1] contains an unknown parameter [_type] [type=illegal_argument_exception]","level":"error"}