jdbc 的未知设置“jdbc_user”

问题描述 投票:0回答:1

这是我的conf文件,我想将我的数据从mysql传输到postgres或者你可以考虑作为多个数据库实例

input {
  jdbc {
    jdbc_driver_library => "C:/Users/pc/Desktop/mysql-conf/mysql-connector-j-8.2.0.jar"
    jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://localhost:3306/write_db"
    jdbc_user => "root"
    jdbc_password => "root"
    statement => "SELECT * FROM write_db.customer_detail WHERE verificationStatus = 'VERIFIED'"
    schedule => "*/1 * * * *"
  }
}

filter {
  # Add your filter conditions here
}

output {
  jdbc {
    jdbc_driver_library => "C:/Users/pc/Desktop/postgresql-conf/postgresql-42.5.4.jar"
    jdbc_driver_class => "org.postgresql.Driver"
    jdbc_connection_string => "jdbc:postgresql://localhost:5432/read_db"
    jdbc_user => "postgres"
    jdbc_password => "root"
    statement => "INSERT INTO read_db.customer_detail(address, firstname, gender, lastname, phonenumber, verificationstatus) VALUES (?, ?, ?, ?, ?, ?)"
  }
}

我不知道为什么我一直遇到这个问题,与conf文件有什么关系吗?

""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_user' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_user' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_password' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_password' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_driver_library' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_driver_library' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_connection_string' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_connection_string' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_driver_class' for jdbc
""2023-11-06 14:42:19 [ERROR] [jdbc]: Unknown setting 'jdbc_driver_class' for jdbc
""2023-11-06 14:42:19 [ERROR] [agent]: Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"Java::JavaLang::IllegalStateException", :message=>"Unable to configure plugins: (ConfigurationError) Something is wrong with your configuration.", :backtrace=>["org.logstash.config.ir.CompiledPipeline.<init>(CompiledPipeline.java:120)", "org.logstash.execution.AbstractPipelineExt.initialize(AbstractPipelineExt.java:186)", "org.logstash.execution.AbstractPipelineExt$INVOKER$i$initialize.call(AbstractPipelineExt$INVOKER$i$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:847)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1318)", "org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:139)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:367)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:452)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)", "org.jruby.RubyClass.newInstance(RubyClass.java:931)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:452)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:561)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:367)", 
"org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)", "org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:88)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:228)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:516)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:293)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:328)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:66)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)", "org.jruby.runtime.Block.call(Block.java:143)", "org.jruby.RubyProc.call(RubyProc.java:352)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:110)", "java.base/java.lang.Thread.run(Thread.java:1623)"]} 

我觉得输出的插件配置是错误的,但不确定。有人可以帮忙吗?

logstash logstash-configuration logstash-file logstash-jdbc
1个回答
0
投票

我查了官方文档,没有找到名为 jdbc 的输出插件。也许你应该使用另一个输出插件?

这里是文档:https://www.elastic.co/guide/en/logstash/current/output-plugins.html

© www.soinside.com 2019 - 2024. All rights reserved.