Hi everyone!
I'm trying to transport data from MySQL table INFORMATION_SCHEMA.PROCESSLIST
via Logstash jdbc plugin.
I never worked with jdbc before so I installed jdbc with sudo apt-get install libmysql-java
command and created the following mysql.conf file in logstash conf.d directory:
input {
jdbc {
jdbc_driver_library => "/usr/share/java/mysql-connector-java-5.1.45.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/es_db"
jdbc_user => <user12>
jdbc_password => <user>
jdbc_paging_enabled => true
tracking_column => "unix_ts_in_secs"
use_column_value => true
tracking_column_type => "numeric"
schedule => "*/5 * * * * *"
statement => "SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST"
}
}
output {
# stdout { codec => "rubydebug"}
elasticsearch {
hosts => ["localhost:9200"]
index => "rdbms_sync_idx"
}
}
The error my logs show me when I try to restart Logstash is:
logstash[8678]: [2020-01-31T09:10:47,994][ERROR][logstash.agent] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \\t\\r\\n], \"#\", [A-Za-z0-9_-], '\"', \"'\", [A-Za-z_], \"-\", [0-9], \"[\", \"{\" at line 34, column 18 (byte 1200) after input {\n jdbc {\n jdbc_driver_library => \"/usr/share/java/mysql-connector-java-5.1.45.jar\"\n jdbc_driver_class => \"com.mysql.jdbc.Driver\"\n jdbc_connection_string => \"jdbc:mysql://localhost:3306/es_db\"\n jdbc_user => ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2584:in `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:156:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:26:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:326:in `block in converge_state'"]}
The config file doesn't even have 34 line Where do you think is a problem?
I also tried the tutorial from Elastic blog where I tried to set everything like there is and it showed me the same error. Could it be caused by different version of jdbc ?
Thanks for any ideas!!