# Avoiding duplicate entries when using JDBC output to file

**URL:** <https://discuss.elastic.co/t/avoiding-duplicate-entries-when-using-jdbc-output-to-file/169445>\
**Category:** Logstash\
**Created:** [February 21, 2019, 3:20pm UTC](https://discuss.elastic.co/t/avoiding-duplicate-entries-when-using-jdbc-output-to-file/169445 "2019-02-21T15:20:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wesch](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wesch](https://discuss.elastic.co/u/wesch)\
**Post date:** [February 21, 2019, 3:20pm UTC](https://discuss.elastic.co/t/avoiding-duplicate-entries-when-using-jdbc-output-to-file/169445/1 "2019-02-21T15:20:14Z")

</div>

Hi all,

New to Logstash, was wondering how to go about this.. I've managed to get output to file working correctly, but would like to avoid duplicate entries. Having done some reading up, this seems to be possible using "document\_id" in the output, however I'm assuming this only works when doing output to elasticsearch?

I am required to output the data to a log file, see config below. Any help would be much appreciated!

output {  
file {  
path =\> "/data/logs/winsql.log"  
}  
stdout {  
codec =\> "rubydebug"  
}  
}

---

<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:** [March 21, 2019, 3:20pm UTC](https://discuss.elastic.co/t/avoiding-duplicate-entries-when-using-jdbc-output-to-file/169445/2 "2019-03-21T15:20:14Z")

</div>

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