Home > Back-end >  Set up a connection with logstash mysql to elasticsearch
Set up a connection with logstash mysql to elasticsearch

Time:11-08

Problems I set to do this for two minutes, but he has been indexed to elasticsearch, why don't you to set up the database is not updated in elasticsearch indexed
The code is as follows:
Input {
JDBC {
# database
Jdbc_connection_string=& gt; "JDBC: mysql://192. * * *. *. * * * : 3306/jboa? CharacterEncoding=utf8 & amp; UseSSL=false& ServerTimezone=UTC& RewriteBatchedStatements=true "
# database user password
Jdbc_user=& gt; "Root"
Jdbc_password=& gt; "Root"
Position # mysql jar package
Jdbc_driver_library=& gt; "/usr/local/mysql connector/mysql connector - Java - 8.0.18. Jar"
# JDBC driver package
Jdbc_driver_class=& gt; ". Com. Mysql. Cj. JDBC Driver "
# JDBC support paging
Jdbc_paging_enabled=& gt; "True"
# synchronous data paging Settings
Jdbc_page_size=& gt; "50000"
# read SQL statement
The statement=& gt; "SELECT * FROM biz_check_result
"# timed execution time
The schedule=& gt; "2 * * * * */"
The type of # index
Type=& gt; "Vision"
}
}
The output {
If [type]=="vision" {
Elasticsearch {
Hosts=& gt; [" 192. * * *. *. * * * : 9200 "]
The index=& gt; "Vision - % {+ YYYY. MM. Dd}"
User=& gt; "Elastic `
"Password=& gt; "Changeme"
}
}
}
  • Related