# JDBC duplicate messages - Logstash still created it's own document\_id after replaced with other value

**URL:** <https://discuss.elastic.co/t/jdbc-duplicate-messages-logstash-still-created-its-own-document-id-after-replaced-with-other-value/48139>\
**Category:** Logstash\
**Created:** [April 22, 2016, 8:30am UTC](https://discuss.elastic.co/t/jdbc-duplicate-messages-logstash-still-created-its-own-document-id-after-replaced-with-other-value/48139 "2016-04-22T08:30:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadowman13](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@shadowman13](https://discuss.elastic.co/u/shadowman13)\
**Post date:** [April 22, 2016, 8:30am UTC](https://discuss.elastic.co/t/jdbc-duplicate-messages-logstash-still-created-its-own-document-id-after-replaced-with-other-value/48139/1 "2016-04-22T08:30:33Z")

</div>

Dear supports,

I'm trying to use jdbc plugin to upload SQL server data to Elasticsearch,  
I'm using logstash cluster with 2 nodes, this is my config on 2 nodes:  
+input {  
jdbc {  
......  
statement =\> "SELECT \* FROM logs WHERE timestart \> :sql\_last\_value order by timestart asc"  
tracking\_column =\> "timestart"  
use\_column\_value =\> true  
schedule =\> "\*/1 \* \* \* \*"  
type =\> "sql-server"  
}  
}

+filter {}

+output {  
if [type] == "sql-server" {  
elasticsearch {  
hosts =\> "localhost:9200"  
document\_id =\> "%{executionid}"  
}  
}  
}

To take new values only I used the :sql\_last\_value, but there's still problem with duplicate message  
so I tried to use document\_id to track the unique value in my table 'executionid' but the issue went weird when even the \_id had been replaced with 'executionid', Elasticsearch still got 2 more same messages with different \_id  
and same timestamp.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/7/797adf39220e0b84861e583cba5aa30d4cd59a5e.png)

Is there something wrong with my configs? Please help me

---

<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 6, 2017, 5:00am UTC](https://discuss.elastic.co/t/jdbc-duplicate-messages-logstash-still-created-its-own-document-id-after-replaced-with-other-value/48139/2 "2017-07-06T05:00:52Z")

</div>


