将 mysql 数据传输到 kibana 时出现日志存储配置错误,sql db 密码为空,所以我传递 jdbc_password= " "



我想使用Logstash和JDBC将MySQL表数据上传到kibana
MYSql数据库用户名为"root",密码为空。我尝试将密码设置为"one_answers","Null",但不起作用。

这是我的logstash配置文件:

input {
jdbc {
jdbc_driver_library => "C:/elasticsearch-7.3.0/driver/com.mysql.jdbc_5.1.5.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/dbname?useSSL=false"
jdbc_user => "root"
jdbc_password=>" " 
statement => "SELECT * FROM table"
}
}
output {  
stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost"]
index => "index_name"
}
}

logstash输出:

〔2019-11-06T13:02:28143〕〔错误〕〔logstash.inputs.jdbc〕加载C:\elasticsearch-7.3.0/driver/com.mysql.jdbc_5.1.5.jar失败{:exception=>#}〔2019-11-06T13:02:28146〕〔错误〕〔logstash.javapipeline〕插件出现无法恢复的错误。将重新启动此插件。Pipeline_id:main插件:"root",jdbc_password=>,statement=>"SELECT*FROM tracker",jdbc_driver_library=>"C:\elasticsearch-7.3.0/driver/com.mysql.jdbc_51.5.jar",jdbc_connection_string=>"jdbc:mysql://localhost:3306/pvtrace?useSSL=false",id=>"5ccb173adcbec4cd0c68701c4737d83e11f82fdc157788bc9b76507e2a70a06",jdbc_driver_class=>"com.mysql.jdbc.driver",enable_metric=>true,codec=>"plain-feefd4fd8-c2ca-4050-8044-04f446e0c157",enable_metric=>true,charset=>"UTF-8">,jdbc_paging_enabled=>false,jdbc_age_size=>100000,jdbc_validate_connection=>false,jdbc_validation_timeout=>3600,jdbc_pool_timeout=>5,sql_log_level=>"信息",connection_retry_attempts=>1,connection_retry_attempts_wait_time=>0.5,parameters=>{"sql_last_value"=>1970-01-01 00:00:00 UTC},last_run_metadata_path=>"C:\Users\himanshika.yeduvans/.logstash_jdbc_last_run",use_column_value=>false,tracking_column_type=>"numeric",clean_run=>false,record_last_run=>true,lowercase_column_names=>true>错误:com.mysql.jdbc.Driver未加载。您确定在:jdbc_Driver_library中包含了正确的jdbc驱动程序吗?异常:LogStash::ConfigurationError堆栈:C:\logstash-7.3.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:在open_jdbc_connection' C:/logstash-7.3.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:inexecute_statement中'C:/logstash-7.3.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:在execute_query' C:/logstash-7.3.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in运行中'C:/logstash-7.3.0/logstash core/lib/logstash/java_pipeline.rb:309:在start_input中的inputworker' C:/logstash-7.3.0/logstash-core/lib/logstash/java_pipeline.rb:302:in块中'〔2019-11-06T13:03:31349〕〔警告〕〔logstash.runner〕收到SIGINT。正在关闭。〔2019-11-06T13:03:32070〕〔错误〕〔logstash.inputs.jdbc〕无法加载C:\elasticsearch-7.3.0/driver/com.mysql.jdbc_5.1.5.jar{:exception=>#}〔2019-11-06T13:03:36354〕〔警告〕〔logstash.runner〕收到关闭信号,但管道仍在等待飞行中的事件待处理。发送另一个^C将强制退出Logstash,但这可能会导致数据丢失。

检查jdbc驱动程序是否存在于上述路径中

"C:/elasticsearch-7.3.0/driver/com.mysql.jdbc_5.1.5.jar"

相关内容

  • 没有找到相关文章

最新更新