# Duplicating Events using JDBC

**URL:** <https://discuss.elastic.co/t/duplicating-events-using-jdbc/185431>\
**Category:** Logstash\
**Created:** [June 12, 2019, 2:06pm UTC](https://discuss.elastic.co/t/duplicating-events-using-jdbc/185431 "2019-06-12T14:06:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrunoSdeMenezes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brunosdemenezes/32/46413_2.png) [@BrunoSdeMenezes](https://discuss.elastic.co/u/BrunoSdeMenezes)\
**Post date:** [June 12, 2019, 2:06pm UTC](https://discuss.elastic.co/t/duplicating-events-using-jdbc/185431/1 "2019-06-12T14:06:30Z")

</div>

Hello there, I'm using jdbc input plugin to create an index, but if I run the logstash config, close and open again, it duplicates the events on index.

This is my script:

```
input{
   jdbc{
     jdbc_connection_string => "jdbc:oracle:thin:@// ********:***** / ******"
     jdbc_user => "USER"
     jdbc_password => "PASSWORD"
     jdbc_validate_connection => true
     jdbc_driver_library => "C:\sqldeveloper\jdbc\lib\ojdbc8.jar"
     jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
     statement => "SELECT * FROM SONAE_090_CONTRATOS"
     use_column_value => true
     tracking_column => "id"
     schedule => "0 11-14 * * * "
   }
}

filter {
}
output{

  stdout{
    codec => rubydebug
  }
  elasticsearch{
    hosts => "localhost:9200"
    index => "sonae"
  }

}

```

How can I do to just update the index?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 12, 2019, 2:46pm UTC](https://discuss.elastic.co/t/duplicating-events-using-jdbc/185431/2 "2019-06-12T14:46:38Z")

</div>

Use a fingerprint filter to set the document\_id option on the elasticsearch output.

---

<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 10, 2019, 2:46pm UTC](https://discuss.elastic.co/t/duplicating-events-using-jdbc/185431/3 "2019-07-10T14:46:38Z")

</div>

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