lib/logstash/inputs/jdbc.rb in logstash-input-jdbc-4.0.1 vs lib/logstash/inputs/jdbc.rb in logstash-input-jdbc-4.0.2
- old
+ new
@@ -183,9 +183,15 @@
unless @statement.nil? ^ @statement_filepath.nil?
raise(LogStash::ConfigurationError, "Must set either :statement or :statement_filepath. Only one may be set at a time.")
end
@statement = File.read(@statement_filepath) if @statement_filepath
+
+ if (@jdbc_password_filepath and @jdbc_password)
+ raise(LogStash::ConfigurationError, "Only one of :jdbc_password, :jdbc_password_filepath may be set at a time.")
+ end
+
+ @jdbc_password = File.read(@jdbc_password_filepath).strip if @jdbc_password_filepath
end # def register
def run(queue)
if @schedule
@scheduler = Rufus::Scheduler.new(:max_work_threads => 1)