logstash-input-jdbc:“jdbc {:level=>:error} 的未知设置 'jdbc_driver_libary'”
logstash-input-jdbc: “Unknown setting 'jdbc_driver_libary' for jdbc {:level=>:error}”
我尝试使用 logstash 访问 MySQL 服务。我安装了 logstash-input-jdbc (/opt/logstash/bin/logstash-plugin install logstash-input-jdbc) 并创建了 /etc/logstash/conf .d/sample.conf:
input{
lumberjack{
...
}
jdbc{
type => "jdbc_hfc"
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/test"
jdbc_user => "root"
jdbc_password => ""
jdbc_validate_connection => true
jdbc_driver_libary => "mysql-connector-java-5.1.40-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM hfc"
schedule => "00 07 * * *"
}
file{
...
}
}
output{
if [type] == "jdbc_hfc"
{
elasticsearch{
protocl => http
hosts => ["localhost:9200"]
index => "logstash-jdbc-hfc-%{+YYYY.MM.dd}"
}
}
}
当我执行配置测试时(/opt/logstash/bin/logstash --configtest -f /etc/logstash/conf.d/sample.conf),我得到下一个错误:
Unknown setting 'jdbc_driver_libary' for jdbc {:level=>:error}
The given configuration is invalid. Reason: Something is wrong with your configuration. {:level=>:fatal}
当我评论 jdbc_connection_string 行时,configtest returns:
Configuration OK
但是当我执行 sample.conf 文件时,logstash 向我返回下一个错误:
Pipeline aborted due to error {:exception=>"LogStash::ConfigurationError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.1/lib/logstash/plugin_mixins/jdbc.rb:159:in `prepare_jdbc_connection'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.1/lib/logstash/inputs/jdbc.rb:187:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in `start_pipeline'"], :level=>:error}
我的错误在哪里?我该怎么做才能解决这个问题?
非常感谢和最诚挚的问候。
PD:如果您需要更多信息,请问我。
第一个错误说明了一切:
Unknown setting 'jdbc_driver_libary' for jdbc {:level=>:error}
所以您的配置中有错别字:
jdbc_driver_libary => "mysql-connector-java-5.1.40-bin.jar"
应该阅读
jdbc_driver_library => "mysql-connector-java-5.1.40-bin.jar"
^
|
我尝试使用 logstash 访问 MySQL 服务。我安装了 logstash-input-jdbc (/opt/logstash/bin/logstash-plugin install logstash-input-jdbc) 并创建了 /etc/logstash/conf .d/sample.conf:
input{
lumberjack{
...
}
jdbc{
type => "jdbc_hfc"
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/test"
jdbc_user => "root"
jdbc_password => ""
jdbc_validate_connection => true
jdbc_driver_libary => "mysql-connector-java-5.1.40-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM hfc"
schedule => "00 07 * * *"
}
file{
...
}
}
output{
if [type] == "jdbc_hfc"
{
elasticsearch{
protocl => http
hosts => ["localhost:9200"]
index => "logstash-jdbc-hfc-%{+YYYY.MM.dd}"
}
}
}
当我执行配置测试时(/opt/logstash/bin/logstash --configtest -f /etc/logstash/conf.d/sample.conf),我得到下一个错误:
Unknown setting 'jdbc_driver_libary' for jdbc {:level=>:error}
The given configuration is invalid. Reason: Something is wrong with your configuration. {:level=>:fatal}
当我评论 jdbc_connection_string 行时,configtest returns:
Configuration OK
但是当我执行 sample.conf 文件时,logstash 向我返回下一个错误:
Pipeline aborted due to error {:exception=>"LogStash::ConfigurationError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.1/lib/logstash/plugin_mixins/jdbc.rb:159:in `prepare_jdbc_connection'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.1/lib/logstash/inputs/jdbc.rb:187:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in `start_pipeline'"], :level=>:error}
我的错误在哪里?我该怎么做才能解决这个问题?
非常感谢和最诚挚的问候。
PD:如果您需要更多信息,请问我。
第一个错误说明了一切:
Unknown setting 'jdbc_driver_libary' for jdbc {:level=>:error}
所以您的配置中有错别字:
jdbc_driver_libary => "mysql-connector-java-5.1.40-bin.jar"
应该阅读
jdbc_driver_library => "mysql-connector-java-5.1.40-bin.jar"
^
|