Include session variables in the connection string for jdbc_static fails

Hello, i want to use the jdbc_static plugin from logstash, but it throws an error:

[2022-11-22T13:36:19,153][WARN ][org.mariadb.jdbc.message.server.ErrorPacket][pipeline_name] Error: 1064-42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ';) AS "T1" LIMIT 1' at line 1

So, this error is well known. The plugin tries to count the result set and send a query with quotes to the database server. The database server isn't configured with "SET GLOBAL sql_mode = 'ansi_quotes'" and i'm not able to change this. I've read, that you can modify the jdbc connection string as workaround, like this:

jdbc_connection_string => "jdbc:mariadb://dbhost:3306/db?sessionVariables=sql_mode=ANSI_QUOTES"

But this will not work at my site. The error is the same as above. If i connect directly to the db server and set the ansi_quotes in the actual session, i can fire up the query including quotes without problems. So, what i'm doing wrong? I'm using the jdbc driver lib mariadb-java-client-3.1.0.jar (latest).

cheers,
Muecker

This is an open issue. See also the issue that links to.