Error connecting MySQL with Logstash

mysql.conf
input{
jdbc {
jdbc_driver_library => "C:\ELK\mysql-connector-java-5.1.36-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/test"
jdbc_user => "root"
jdbc_password => "Password"
schedule => "5 * * * * *"
statement => "SELECT * from cars"
use_column_value => "true"
tracking_column-type => "timestramp"
}
}

output{

elasticsearch{

	index => "id"
	document type => "cars"
	document id => "%(ID)"
	hosts => "localhost:9200"
}

stdout{
	codec => rubydebug
}

}

Error
[2019-06-06T22:33:03,078][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 20, column 12 (byte 481) after output{\r\n\r\n\telasticsearch{\r\n\r\n\t\tindex => "id"\r\n\t\tdocument ", :backtrace=>["C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:inmap'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:ininitialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:23:ininitialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/agent.rb:325:inblock in converge_state'"]}

Any help would be appreciated. Thank you in Advance.

You are missing underscores in the option names.

If you are just getting started you probably do not want to use document_type, since document types are being eliminated.

Yes, I am new to this technology and learning it, along with its implementation.

I tried running the code, with the errors which you told. But then after I am facing again a new error.

New Error Message

[2019-06-06T23:09:56,278][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Something is wrong with your configuration.", :backtrace=>["C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/config/mixin.rb:86:in config_init'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/inputs/base.rb:60:ininitialize'", "org/logstash/plugins/PluginFactoryExt.java:255:in plugin'", "org/logstash/plugins/PluginFactoryExt.java:117:inbuildInput'", "org/logstash/execution/JavaBasePipelineExt.java:50:in initialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:23:ininitialize'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "C:/ELK/logstash-7.1.1/logstash-core/lib/logstash/agent.rb:325:inblock in converge_state'"]}

There should be another message preceding that one.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.