# Tracking\_column in JDBC input plugin

**URL:** <https://discuss.elastic.co/t/tracking-column-in-jdbc-input-plugin/127362>\
**Category:** Logstash\
**Created:** [April 9, 2018, 5:14pm UTC](https://discuss.elastic.co/t/tracking-column-in-jdbc-input-plugin/127362 "2018-04-09T17:14:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujeetKumar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sujeetKumar](https://discuss.elastic.co/u/sujeetKumar)\
**Post date:** [April 9, 2018, 5:14pm UTC](https://discuss.elastic.co/t/tracking-column-in-jdbc-input-plugin/127362/1 "2018-04-09T17:14:43Z")

</div>

I just want to understand how it really works in deep.

In my case, I have a table where I have a datetime column last\_modified\_date.

I kept this as tracking column and I want to achieve:

- If the row is getting updated in SQL, tracking column will also updated. In such case the document should also update in elasticsearch if exists with the same ID. It will not create a duplicate document if the same ID already exists in elasticsearch.

Correct me if I am wrong.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 10, 2018, 6:31pm UTC](https://discuss.elastic.co/t/tracking-column-in-jdbc-input-plugin/127362/2 "2018-04-10T18:31:20Z")

</div>

This is correct. Of course, your jdbc input and elasticsearch output need to be configured accordingly.

---

<div class="post-metadata">

**Author:** ![sujeetKumar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sujeetKumar](https://discuss.elastic.co/u/sujeetKumar)\
**Post date:** [April 10, 2018, 8:41pm UTC](https://discuss.elastic.co/t/tracking-column-in-jdbc-input-plugin/127362/3 "2018-04-10T20:41:46Z")

</div>

Thanks @magnusbaeck.... I have done this in right manner then. I am surprised to see few rows (5-6 out of 50000) are indexed as duplicate documents. I will recheck my jdbc configuration and documentIDs.

---

<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:** [May 8, 2018, 8:42pm UTC](https://discuss.elastic.co/t/tracking-column-in-jdbc-input-plugin/127362/4 "2018-05-08T20:42:04Z")

</div>

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