JDBC input parameters add quotes to query

I'm trying to use jdbc input filter to query Oracle DB and to template a schema name. My statement looks like this:

select count(1) from :schema.my_table

And my logstash config is like this:

input {
   [...connection attributes...]
    jdbc {
        statement => "select count(1) from :schema.my_table"
        parameters => {"schema" => "my_schema"}

And the the resulting query going to Oracle is like this:

select count(1) from 'my_schema'.my_table

So it adds a single quotes to my parameters making my query to fail with "ORA-00903: invalid table name".

How do I get rid of single qoutes added by logstash? Or, at least, to replace it with double quotes instead?

1 Like

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