赞
踩
一、检查配置文件
logstash -f PATH_TO/logstash.conf -t
比如我的路径:
logstash.conf
文件为UTF-8,使用notepad++将文件转换为UTF-8无BOM编码就可以了=>
-f PATH_TO/logstash.conf
发现password后面多了个:问题解决。
二、配置文件
- input {
- jdbc{
- jdbc_driver_library => "G:\\software\\elasticSearch\\logstash-7.2.0\\logstash-7.2.0\\mysql-connector-java-8.0.13.jar"
-
- jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
-
- jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/learn_test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai"
-
- jdbc_user => "root"
-
- jdbc_password => "root"
-
- schedule => "* * * * *"
-
- clean_run => true
-
- statement => "SELECT * FROM gyss_project_learn WHERE update_time > :sql_last_value AND update_time < NOW() ORDER BY update_time desc"
-
-
- }
-
- }
-
- output {
- elasticsearch {
- hosts => "127.0.0.1:9200"
- index => "learn"
- document_id => "%{id}"
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。