Is it possible to dynamically set the connection string on a jdbc_streaming filter?
Something like this for example:
mutate {
add_field => {
"connection_string" => "jdbc:sqlserver://test.mydb.com:1433;databaseName=%{[database_name]};integratedSecurity=false;trustServerCertificate=true"
}
}
jdbc_streaming {
jdbc_connection_string => "%{[connection_string]}"
jdbc_user => "test-user"
jdbc_password => "test-pass"
jdbc_driver_library => "C:\Program Files\Logstash\resources\drivers\mssql-jdbc-10.2.1.jre17.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
statement => "SELECT * FROM my-table"
}
Based on my testing it does not seem possible in 7.17 as when I tried this the pipeline failed to be created:
Pipeline error {:pipeline_id=>"test-pipeline", :exception=>#<URI::InvalidURIError: bad URI(is not URI?): %{[connection_string]}>,