# Multiple Instances of Logstash JDBC input

**URL:** <https://discuss.elastic.co/t/multiple-instances-of-logstash-jdbc-input/204147>\
**Category:** Logstash\
**Created:** [October 18, 2019, 1:00am UTC](https://discuss.elastic.co/t/multiple-instances-of-logstash-jdbc-input/204147 "2019-10-18T01:00:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bnered](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@bnered](https://discuss.elastic.co/u/bnered)\
**Post date:** [October 18, 2019, 1:00am UTC](https://discuss.elastic.co/t/multiple-instances-of-logstash-jdbc-input/204147/1 "2019-10-18T01:00:16Z")

</div>

My Requirement is to fetch updated/new records from the table. I used the sql\_last\_value to fetch the latest the records. I want to run logstash in multiple instances to avoid os/hardware crashes and get continuous updates. But sql\_last\_value is updating in each instance separately this is causing duplicate data or same query running multiple times with same time stamp. Is anyone tried to read sql\_last\_value from centralized location for multiple instances to avoid redundant queries to DB?

I used the following JDBC input:

```auto
input {
  jdbc {
    jdbc_connection_string => ""    
    jdbc_user => ""
    jdbc_password => ""
    # The path to downloaded jdbc driver
    jdbc_driver_library => "/app/logstash/jdbc/ojdbc6.jar"
    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    # The path to the file containing the query
    statement => "SELECT * FROM TEST1 WHERE modifyts > :sql_last_value"
    schedule => "*/5 * * * *"
    use_column_value => false
    #tracking_column => "MODIFYTS"
    lowercase_column_names => false
    last_run_metadata_path => "/centralized-location/last-run/logstash_jdbc_last_run_test1_log"
    record_last_run => true
    sql_log_level => "debug"
    #tracking_column_type => "timestamp"
    jdbc_default_timezone => "America/Los_Angeles"
    id => "test1"
  }
}

```

Any suggestions?

---

<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:** [November 15, 2019, 1:00am UTC](https://discuss.elastic.co/t/multiple-instances-of-logstash-jdbc-input/204147/2 "2019-11-15T01:00:22Z")

</div>

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