我用mysql同步到es里时时区不对,我设置了过滤条件也不行,有大神能帮忙看看是什么情况吗
配置如下
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/test"
jdbc_user => "root"
jdbc_password => "123456"
jdbc_driver_library => "/data/logstash-5.6.7/mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement => "SELECT * from contacts"
schedule => "* * * * *"
type => "jdbc"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
date {
match => [ "test_time", "yyyy-MM-dd HH:mm:ss" ]
}
mutate {
remove_field => "@timestamp"
}
}
output {
elasticsearch {
host => "127.0.0.1:9200"
index => "contacts"
document_type => "contact"
document_id => "%{uid}"
}
}
数据库数据如下
,同步到es里就是不对,logstash版本5.6.7
配置如下
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/test"
jdbc_user => "root"
jdbc_password => "123456"
jdbc_driver_library => "/data/logstash-5.6.7/mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement => "SELECT * from contacts"
schedule => "* * * * *"
type => "jdbc"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
date {
match => [ "test_time", "yyyy-MM-dd HH:mm:ss" ]
}
mutate {
remove_field => "@timestamp"
}
}
output {
elasticsearch {
host => "127.0.0.1:9200"
index => "contacts"
document_type => "contact"
document_id => "%{uid}"
}
}
数据库数据如下
,同步到es里就是不对,logstash版本5.6.7
0 个回复