# JDBC INPUT plugin not syncing all eligible records from postgres db to elasticsearch

**URL:** <https://discuss.elastic.co/t/jdbc-input-plugin-not-syncing-all-eligible-records-from-postgres-db-to-elasticsearch/335409>\
**Category:** Logstash\
**Created:** [June 7, 2023, 8:43am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-not-syncing-all-eligible-records-from-postgres-db-to-elasticsearch/335409 "2023-06-07T08:43:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gio\_Vanni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gio_vanni/32/121785_2.png) [@Gio\_Vanni](https://discuss.elastic.co/u/Gio_Vanni)\
**Post date:** [June 7, 2023, 8:43am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-not-syncing-all-eligible-records-from-postgres-db-to-elasticsearch/335409/1 "2023-06-07T08:43:00Z")

</div>

Hi I have an issue whereby logstash doesn't update all records that are returned by the jdbc-input query to Elasticsearch.As a result we always have to restart logstash to force through the updates.

input plugin config:

```
jdbc {
jdbc_driver_library => " ********"
jdbc_driver_class => "org.postgresql.Driver"
jdbc_connection_string => "${jdbc_connection_string}"
jdbc_user => "${jdbc_user}"
jdbc_password => "${jdbc_password}"
tracking_column => "mi_last_modified_date_unix_ts"
jdbc_paging_enabled => true
jdbc_page_size => 100
use_column_value => true
tracking_column_type => "numeric"
schedule => "${schedule}"
statement => "select *, extract(epoch from to_timestamp(last_modified_date,'YYYY-MM-DD HH24:MI:SS')) as mi_last_modified_date_unix_ts from table where last_modified_date is not null and (extract(epoch from to_timestamp(last_modified_date, 'YYYY-MM-DD HH24:MI:SS')) > :sql_last_value) order by last_modified_date asc"

```

}

On average there 1500 records that have their last\_modified\_date updated but we always find that around 100 do not sync through.

Any help would be greatly appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2023, 8:44am UTC](https://discuss.elastic.co/t/jdbc-input-plugin-not-syncing-all-eligible-records-from-postgres-db-to-elasticsearch/335409/2 "2023-07-05T08:44:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
