# Getting the same values multiple times while integrating Mysql with Logstash

**URL:** <https://discuss.elastic.co/t/getting-the-same-values-multiple-times-while-integrating-mysql-with-logstash/316277>\
**Category:** Logstash\
**Created:** [October 11, 2022, 7:13am UTC](https://discuss.elastic.co/t/getting-the-same-values-multiple-times-while-integrating-mysql-with-logstash/316277 "2022-10-11T07:13:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ritikapawar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ritikapawar/32/98580_2.png) [@Ritikapawar](https://discuss.elastic.co/u/Ritikapawar)\
**Post date:** [October 11, 2022, 7:13am UTC](https://discuss.elastic.co/t/getting-the-same-values-multiple-times-while-integrating-mysql-with-logstash/316277/1 "2022-10-11T07:13:37Z")

</div>

I've created a pipeline to get data directly from Mysql to kibana using logstash and Jdbc input plugin  
But when I do the actual execution on **.conf** file I'm getting the same values multiple time in the elastic index.

here's my .conf file

```auto
input {
  jdbc {
    jdbc_driver_library => "/usr/share/java/mysql-connector-java-8.0.30.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/database"
    jdbc_user => "root"
    jdbc_password => "root"
    tracking_column => "id"
    use_column_value => true
    tracking_column_type => "numeric"
    schedule => "* * * * *"
    clean_run => true
    
    statement => "SELECT * from products"
  }
}

filter {
  mutate {
    copy => { "id" => "[@metadata][_id]"}
    remove_field => ["@version"]
  }
}

output {
 elasticsearch {
    hosts=>["http://localhost:9200"]
    user=>"elastic"
    password=>" *******"
    index=>"mysql" }

  stdout { codec => "rubydebug"}

```

Is there something that I'm missing here?

---

<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:** [October 11, 2022, 2:37pm UTC](https://discuss.elastic.co/t/getting-the-same-values-multiple-times-while-integrating-mysql-with-logstash/316277/2 "2022-10-11T14:37:22Z")

</div>

> [@Ritikapawar](#):
>
> ```auto
> clean_run => true    
> statement => "SELECT * from products"
> 
> ```

You should expect duplicate data when you do this. When clean\_run is set to true the saved tracking value is not used, plus your query does not reference the tracking value at all. This will fetch the entire table every time.

---

<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 8, 2022, 2:38pm UTC](https://discuss.elastic.co/t/getting-the-same-values-multiple-times-while-integrating-mysql-with-logstash/316277/3 "2022-11-08T14:38:10Z")

</div>

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