[英]logstash input jdbc take mysql tinyint 0/1 as boolean true/false
在 mysql 表中,有一个类似这样的 tinyint 类型,它只存储 0 或 1 值,如is_mel:1
。
is_mel | tinyint(1)
在 Elasticsearch 索引映射配置 is_mel 为 integer。
但是从logstash日志中,它显示它将is_mel解析为 boolean 值 true 或 false 像"is_mel":true
,这将导致以下错误,
"type"=>"mapper_parsing_exception",
"reason"=>"failed to parse field [is_mel] of type [integer] in document with id '392289'. Preview of field's value: 'true'"
它实际上是一个功能,而不是一个错误:-)
您可以 append tinyInt1isBit=false
对您的 JDBC URL 禁用该行为
jdbc.url=jdbc:mysql://127.0.0.1:3306/testdb?tinyInt1isBit=false
^
|
add this
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.