Why the input-jdbc plugin automatically converts the MySQL database tinyint data type to boolean type?

Hi,everyone!
I‘m a green hand to logstash.’This is the first attempt to synchronize MySQL data with logstash today.However, when I used the JDBC plugin, it encountered some problems. MySQL data is set to tinyint, it turns to boolean with input-jdbc which I don't expect.
MySQL data type:
image
input-jdbc log:


What should I do to make it not automatically converted?
We look forward to your reply, and will be appreciate.

You must CAST it in your SQL statement.

Thank you for your reply.I've solved this problem.I added a parameter(tinyInt1isBit=false) to the value of jdbc_connection_string, and then it will work properly.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.