JDBC Input parameters adds a N'' within the query


(PB) #1

Hi Guys,

I'm trying to exact resultset from Microsoft SQL Server using JDBC but i have stumbled upon an issue.
Here's the config:

input {
jdbc {
parameters => {
database => ABC
}
jdbc_driver_library => "/usr/share/logstash/lib/drivers/sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "server:1433"
jdbc_user => "login"
jdbc_password => "pwd"
schedule => "*/1 * * * *"
statement_filepath => "/etc/logstash/conf.d/query.sql"
use_column_value => true
tracking_column_type => "numeric"
tracking_column => "id"
last_run_metadata_path => "/usr/share/logstash/last_run_metadata/.query"
record_last_run => true
}
}

The query looks like this:

select * from :database.dbo.table

Logstash is unable to retreive any result, due to an error with the query. In the log i can see that's it's trying to execute the following:

select * from N'ABC'.dbo.table

Any idea how to get rid of N'' in table name? I know it's a matter of using National language character set but I would like to overcome this.
I'd appreciate the help, thanks!

I tried using quotes, double quotes but the outcome is exactly the same.


(PB) #2

Hi Guys, any ideas?