Tôi muốn xuất bảng tom_test2 postgresql sang tìm kiếm đàn hồi. Bảng này có 176.805 hàng:logstach: jdbc_page_size không đổ tất cả dữ liệu của tôi vào tìm kiếm đàn hồi
=> select count(*) from tom_test2;
count
--------
176805
(1 row)
sau Việc nhập khẩu logstach file conf một cách chính xác dữ liệu của tôi để tìm kiếm đàn hồi:
input {
jdbc {
# Postgres jdbc connection string to our database, mydb
jdbc_connection_string => "xxx"
# The user we wish to execute our statement as
jdbc_user => "xxx"
jdbc_password => "xxx"
# The path to our downloaded jdbc driver
jdbc_driver_library => "xxx"
# The name of the driver class for Postgresql
jdbc_driver_class => "org.postgresql.Driver"
# our query
statement => "select * from tom_test2"
}
}
output {
elasticsearch {
hosts => ["xxx"]
index => "tom"
document_type => "tom_test"
}
}
Trong tìm kiếm đàn hồi:
GET tom/tom_test/_search
"hits": {
"total": 176805,
"max_score": 1,
}
tôi đang xóa index của tôi trong tìm kiếm đàn hồi:
delete tom
Và bây giờ tôi muốn làm các hoạt động tương tự sử dụng jdbc_page_size trong trường hợp dữ liệu của tôi trở nên lớn hơn, file conf logstach của tôi bây giờ là:
input {
jdbc {
# Postgres jdbc connection string to our database, mydb
jdbc_connection_string => "xxx"
# The user we wish to execute our statement as
jdbc_user => "xxx"
jdbc_password => "xxx"
# The path to our downloaded jdbc driver
jdbc_driver_library => "xxx"
# The name of the driver class for Postgresql
jdbc_driver_class => "org.postgresql.Driver"
# our query
statement => "select * from tom_test2"
jdbc_page_size => 1000
jdbc_paging_enabled => true
}
}
output {
elasticsearch {
hosts => ["xxx"]
index => "tom"
document_type => "tom_test"
}
}
đếm của tôi bây giờ là sai:
GET tom/tom_test/_search
"hits": {
"total": 106174,
"max_score": 1,
}
như 176.805 -106174 = 70631 hàng bị thiếu
Bất kỳ bản ghi trong logstash hoặc elasticsearch? Bất kỳ lý do nào để đặt một kích thước trang nhỏ như vậy? (mặc định là 100000) –
Tôi nhận xét thứ hai của Julien, có thêm thông tin nào không? – Val