网上下载的配置文件换行有问题,分享一份我本地修改后的配置

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

空指针1

2020-04-23 18:58

input {

  jdbc {

jdbc_driver_library => "F:\Respository\Maven\mysql\mysql-connector-java\8.0.15\mysql-connector-java-8.0.15.jar"

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

jdbc_connection_string => "jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true"

jdbc_user => "root"

jdbc_password => "Mysql.1236121273.."

schedule => "* * * * *"

statement => "SELECT (p.id+pw.id) id,p.id pid,p.first_name,p.last_name,p.age,p.about,pw.id pw_id,pw.wife_name,pw.wife_age FROM person p LEFT JOIN person_wife pw ON p.id = pw.person_id where (p.update_time >=:sql_last_value and p.update_time<now()) or (pw.update_time >=:sql_last_value and p.update_time<now())"

  }

}


output {

  elasticsearch {

    index => "my_index"

document_type => "_doc"

document_id => "%{id}"

hosts => ["localhost:9200"]

  }

}


写回答 关注

1回答

  • 梦编猿
    2020-06-12 15:07:51

    +1~

Springboot + ElasticSearch 构建博客检索系统

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

22917 学习 · 112 问题

查看课程

相似问题