自己新增了一个mysql.conf 文件 , logstash -f ../config/mysql.conf 同步 报错 没看懂啥错

来源:4-2 logstash全量、增量同步解决方案

weixin_慕数据9518735

2023-12-04 17:34

配置信息

input{

jdbc{

# jdbc 驱动包的位置

jdbc_driver_library => "D:\\logstash\\logstash-6.3.2\\mysql-connector-java-5.1.21.jar"

jdbc_driver_class => "com.mysql.jdbc.Driver"

jdbc_connection_string => "jdbc:mysql://localhost:3306/es-boke?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true"

jdbc_user => "root"

jdbc_password => "12345678"

schedule => "*****"

clean_run => true

statement => "select * from t_blog where update_time > :sql_last_value and update_time< NOW() ORDER BY update_time desc" 

}

}

output{

elasticsearch{

hosts => ["127.0.0.1:9200"]

index => "blog"

document_id => "%{id}"

}

}

报错信息

D:\logstash\logstash-6.3.2\bin>logstash -f ../config/mysql.conf

Sending Logstash's logs to D:/logstash/logstash-6.3.2/logs which is now configured via log4j2.properties

[2023-12-04T17:20:24,108][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified

[2023-12-04T17:20:24,714][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"6.3.2"}

[2023-12-04T17:20:25,091][ERROR][logstash.agent           ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after ", :backtrace=>["D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/compiler.rb:42:in `compile_imperative'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/compiler.rb:50:in `compile_graph'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/compiler.rb:12:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in `map'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/compiler.rb:11:in `compile_sources'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/pipeline.rb:49:in `initialize'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/pipeline.rb:167:in `initialize'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/pipeline_action/create.rb:40:in `execute'", "D:/logstash/logstash-6.3.2/logstash-core/lib/logstash/agent.rb:305:in `block in converge_state'"]}

[2023-12-04T17:20:25,453][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}


写回答 关注

0回答

还没有人回答问题,可以看看其他问题

Springboot + ElasticSearch 构建博客检索系统

Springboot + ElasticSearch 构建个人博客检索系统

22916 学习 · 112 问题

查看课程

相似问题