在 Mapping 里面,将 dynamic 参数设置成 strict 可以拒绝索引包含未知字段的文档。 此条 Tips 由 medcl 贡献。

logstash消费kafka的问题

Logstash | 作者 aceforelastic | 发布于2018年12月20日 | 阅读数:7172


1.png

上图是我的logstash配置文件,目前遇到的问题是,我本地20条数据上传到kafka里面,经过logstash过滤后进入es数据在16-20条不等浮动,这个是什么情况?是logstash对kafka用了订阅模式吗?求教怎么改过来
已邀请:

rochy - rochy_he

赞同来自: aceforelastic fantaigan

1. 对于 kafka 推荐你设置 group_id,而不是设置 client_id;
2. auto_offset_reset 推荐设置 earliest;
3. auto_commit_interval_ms 设置为 1000;
 
 

zhangxinhong

赞同来自: shurllsy

logstash消费kafka数据输出到es,  现在es不可用了, logstash日志里也显示输出到es报错, 但是等es恢复之后, logstash不会再重新消费之前输出报错的数据了,  这是为什么呢??   查找了logstash的官网介绍文档, 没找到auto_commit_error选项, 也就是说即使消费失败了也不会重新消费????

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

参考一下官网的通透解读:https://www.elastic.co/guide/e ... .html
group_idedit

Value type is string
Default value is "logstash"

The identifier of the group this consumer belongs to. Consumer group is a single logical subscriber that happens to be made up of multiple processors. Messages in a topic will be distributed to all Logstash instances with the same group_id

zqc0512 - andy zhou

赞同来自:

group_id

要回复问题请先登录注册