I would like to export the tom_test2 postgresql table to elastic search. The table has 176805 rows:
=> select count(*) from tom_test2;
count
--------
176805
(1 row)
The following confstore logstach file correctly imports my data into elastic search:
input {
jdbc {
jdbc_connection_string => "xxx"
jdbc_user => "xxx"
jdbc_password => "xxx"
jdbc_driver_library => "xxx"
jdbc_driver_class => "org.postgresql.Driver"
statement => "select * from tom_test2"
}
}
output {
elasticsearch {
hosts => ["xxx"]
index => "tom"
document_type => "tom_test"
}
}
In elastic search:
GET tom/tom_test/_search
"hits": {
"total": 176805,
"max_score": 1,
}
I delete the index in the elastic search:
delete tom
And now I would like to perform the same operation using jdbc_page_size, in case my data gets bigger, now my confstach logstach file:
input {
jdbc {
jdbc_connection_string => "xxx"
jdbc_user => "xxx"
jdbc_password => "xxx"
jdbc_driver_library => "xxx"
jdbc_driver_class => "org.postgresql.Driver"
statement => "select * from tom_test2"
jdbc_page_size => 1000
jdbc_paging_enabled => true
}
}
output {
elasticsearch {
hosts => ["xxx"]
index => "tom"
document_type => "tom_test"
}
}
Now my score is incorrect:
GET tom/tom_test/_search
"hits": {
"total": 106174,
"max_score": 1,
}
since 176805-106174 = 70631 lines are missing
source
share