例外:LogStash :: ConfigurationError

时间:2018-05-01 07:09:31

标签: elasticsearch logstash

我试图通过logstash连接Oracle数据库并且遇到错误。

 ClipboardStream = new StreamReader((Stream)ClipboardData.GetData(DataFormats.CommaSeparatedValue));

请找到我的logstash配置文件:

  Error: oracle.jdbc.OracleDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
  Exception: LogStash::ConfigurationError
  Stack: D:/softwares/logstash-6.2.4/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/plugin_mixins/jdbc.rb:162:in `open_jdbc_connection'

2 个答案:

答案 0 :(得分:1)

logstash配置文件:(已更正)

input {
  jdbc {
    jdbc_driver_library => "D:\Karthikeyan\data\ojdbc14.jar"
    jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"  // problem in this line is corrected
    jdbc_connection_string => "jdbc:oracle:thin:@localhost:1521:xe"
    jdbc_user => "vb"
    jdbc_password => "123456"
    statement => "SELECT * FROM VB_PRODUCT"
  }
}

output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "my_index"
  }
}

答案 1 :(得分:1)

您可以使用来验证配置文件

./user/share/logstash/bin/logstash -f etc/logstash/conf.d/sample.conf --config.test_and_exit