我一直在使用logstash从SQL服务器向Elasticsearch加载数百万个数据。但是,每次加载数据时,我都缺少数千条记录。
input {
jdbc {
jdbc_driver_library => "F:\MG_ES\elasticsearch-5.4.3\elasticsearch-5.4.3\lib\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "******"
jdbc_user => "*******"
jdbc_password => "*******"
statement => "select * from ******"
jdbc_paging_enabled => "true"
jdbc_page_size => "500000"
}
}
filter {
mutate {
remove_field => [ "message", "path", "score", "@version", "host" ]
}
#mutate { convert => ["REGCONNTYPEID","integer"]}
#mutate { convert => ["data_time_id","integer"]}
}
output {
elasticsearch {
hosts => "localhost"
index => "sql_elk_fct_data"
document_type => "devices"
document_id => "%{hwgdid}"
}
#stdout { codec => rubydebug { metadata=> true } }
}
查询结果在数据库中记录了2027203条记录,但是,我只能在Kibana中看到以下计数 -
我在Elasticsearch索引中的记录减少了2298。 hwgdid是查询中的唯一且非空字段。 可能是什么原因?