I am trying to pass a fieldname in jdbc_streaming plugin to the jdbc_user parameter, but it fails to read the value of the field

jdbc_streaming {
	jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
	jdbc_driver_library => "/home/user/logstash-7.14.0/logstash-core/lib/jars/ojdbc8.jar"
	jdbc_connection_string => "jdbc:oracle:thin:@XXXXX"
	jdbc_user => "%{jdbc_username}"
	jdbc_password => "XXXXX"
}

This will not work. The connection is setup and authenticated when the plugin is initialized. The code does not sprintf the jdbc_user option because there is no event to refer to at that point.

Thanks Badger, is there a way to pass credentials programmatically to this plugin?

You can probably use environment variables. I would expect them to get substituted at configuration time.

It worked Badger, thanks!

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