Hi,
I'm new in logstash and elasticsearch.
i want to index mysql database to elasticsearch using logstash. i downloded the last versions 5.1.2 (of logstash and elasticsearch).
elasticsearch start without problems.
for logstash, i downloaded mysql connector jar, and put it in bin folder, i also created a file with "logstash.conf" in bin folder :
input {
jdbc {
jdbc_driver_library => "mysql-connector-java-5.1.38.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/ecommerce"
jdbc_user => "root"
jdbc_password => "root"
schedule => "* * * * *"
statement => "select * from products"
}
}
output {
#stdout { codec => json_lines }
elasticsearch {
index => "products"
document_type => "product"
document_id => "%{ProductID}"
hosts => "[localhost:9200]"
}
}
when i start logstash with logstash -f logstash.conf, i get this errors, and my database not indexed
Could not find log4j2 configuration at path /MYENV/outils/elastic512/logstash51
2/config/log4j2.properties. Using default config which logs to console
15:40:42.816 [[main]-pipeline-manager] ERROR logstash.agent - Pipeline aborted d
ue to error {:exception=>#<Psych::SyntaxError: (): 'reader' unacceptabl
e character ' ' (0x0) special characters are not allowed
in "'reader'", position 0 at line 0 column 0>, :backtrace=>["org/jruby/ext/psych
/PsychParser.java:232:in parse'", "C:/MYENV/outils/elastic512/logstash512/vend or/jruby/lib/ruby/1.9/psych.rb:375:in
parse_stream'", "C:/MYENV/outils/elastic
512/logstash512/vendor/jruby/lib/ruby/1.9/psych.rb:323:in parse'", "C:/MYENV/o utils/elastic512/logstash512/vendor/jruby/lib/ruby/1.9/psych.rb:250:in
load'",
"C:/MYENV/outils/elastic512/logstash512/vendor/bundle/jruby/1.9/gems/logstash-i
nput-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:206:in register'", "C:/MYENV/outil s/elastic512/logstash512/logstash-core/lib/logstash/pipeline.rb:353:in
start_in
puts'", "org/jruby/RubyArray.java:1613:in each'", "C:/MYENV/outils/elastic512/ logstash512/logstash-core/lib/logstash/pipeline.rb:352:in
start_inputs'", "C:/E
NV_AT/outils/elastic512/logstash512/logstash-core/lib/logstash/pipeline.rb:228:i
n start_workers'", "C:/MYENV/outils/elastic512/logstash512/logstash-core/lib/l ogstash/pipeline.rb:183:in
run'", "C:/MYENV/outils/elastic512/logstash512/logs
tash-core/lib/logstash/agent.rb:292:in `start_pipeline'"]}
15:40:42.915 [Api Webserver] INFO logstash.agent - Successfully started Logstas
h API endpoint {:port=>9600}
15:40:45.816 [LogStash::Runner] WARN logstash.agent - stopping pipeline {:id=>"
main"}
have you any ideao about this problem ?
i have jdk1.8.0_91 on my machine.
thanks.