elasticsearch - Logstash 错误:拒绝对 [db] 的映射更新,因为最终映射将有超过 1 种类型:[meeting_invities, meetingroom"}}}}
问题描述
Rejecting mapping update to [db] as the final mapping would have more than 1 type: [meeting_invities, meetingroom
"}}}}
下面是我的 logstatsh-mysql.conf 我必须在 jdbc 输入中使用多个表。请指教
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/db"
jdbc_user => "root"
jdbc_password => "pwd"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM meeting"
tags => "dat_meeting"
}
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/db"
jdbc_user => "root"
jdbc_password => "pwd"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM meeting_invities;"
tags => "dat_meeting_invities"
}
}
output {
stdout { codec => json_lines }
if "dat_meeting" in [tags]{elasticsearch {
hosts => "localhost:9200"
index => "meetingroomdb"
document_type => "meeting"
}
}
if "dat_meeting_invities" in [tags]{elasticsearch {
hosts => "localhost:9200"
index => "meetingroomdb"
document_type => "meeting_invities"
}
}
}
解决方案
您的 elasticsearch 输出使用document_type
具有两个不同值的选项,此选项设置_type
索引的字段,从版本 6.X 开始,您的索引中只能有一种类型。
此选项在版本 7.X 中已弃用,并且将在未来版本中删除,因为 elasticsearch 正在变得无类型。
由于elasticsearch不允许您索引多个索引类型,您需要查看您索引的第一个文档的类型,这是elasticsearch将用于任何未来文档的类型,在这两个document_type
选项中都使用它。
推荐阅读
- reactjs - 新用户登录后 Apollo/GraphQL 不进行查询?
- php - 在 PhpStorm 中启用 Xdebug
- javascript - 如何从我的反应应用程序中删除所有会话 cookie?
- sql - 如何更新参考预言机
- sql - SQL FOR JSON:为每个对象创建行
- unity3d - 饱和度渐变 - 后处理
- amazon-web-services - 即使存在信任关系,也无法在 AWS CLI 中担任角色
- typescript - 迁移失败:发现不兼容的对等依赖项
- python - Pandas 用该列的滚动总和替换列值
- node.js - Mongoose:“模式”类型上不存在属性“方法”。您指的是 “method” 吗?