提问人:user9300309 提问时间:11/16/2023 更新时间:11/16/2023 访问量:23
将弹性数据插入 Mysql
Insert Elastic Data to Mysql
问:
我在使用 logstash 将数据从 elastic 传输到 mysql 时遇到了问题。我收到错误“无法执行操作 {:action=>LogStash::P ipelineAction::Create/pipeline_id:main, :exception=>”LogStash::ConfigurationError“,”。生成的错误是:
[ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [^\\r\\n], \"\\r\", \"\\n\" at line 21, column 4 (byte 732) after # }", :backtrace=>["C:/Users/rakesh.s/Documents/ELK/logstash-7.15.0/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:187:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'",
这是我的 Logstash 配置
input {
elasticsearch {
hosts => "localhost:9200"
index => "testrak"
query => '{"query": { "match_all": {} }}'
scroll => "5m"
}
}
output {
jdbc {
jdbc_driver_library => "C:/Program Files (x86)/MySQL/Connector J 8.0/mysql-connector-java-8.0.29.jar"
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/elasticdata"
jdbc_user => "root"
jdbc_password => ""
statement => "INSERT INTO elastic_table (id, incident_number, created_on, service_name, ed) VALUES (?, ?, ?, ?, ?)"
parameters => ["id", "incident_number", "created_on", "service_name", "ed"]
schedule => "* * * * *"
}
}
我不知道,这是怎么回事。请提出建议。
答: 暂无答案
评论
jdbc
jdbc
schedule
schedule