# Insert all records of a table in mysql with no unique column in elastic without repitition

**URL:** <https://discuss.elastic.co/t/insert-all-records-of-a-table-in-mysql-with-no-unique-column-in-elastic-without-repitition/215377>\
**Category:** Logstash\
**Created:** [January 16, 2020, 7:28pm UTC](https://discuss.elastic.co/t/insert-all-records-of-a-table-in-mysql-with-no-unique-column-in-elastic-without-repitition/215377 "2020-01-16T19:28:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RITZ\_VERMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ritz_verma/32/46899_2.png) [@RITZ\_VERMA](https://discuss.elastic.co/u/RITZ_VERMA)\
**Post date:** [January 16, 2020, 7:28pm UTC](https://discuss.elastic.co/t/insert-all-records-of-a-table-in-mysql-with-no-unique-column-in-elastic-without-repitition/215377/1 "2020-01-16T19:28:01Z")

</div>

I want to send data from mysql table to elastic search .I am currently using jdbc plugin but it keep inserting same records again .I have no unique column in my mysql table.is there a way to send the records exactly once

---

<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:** [January 17, 2020, 2:46pm UTC](https://discuss.elastic.co/t/insert-all-records-of-a-table-in-mysql-with-no-unique-column-in-elastic-without-repitition/215377/2 "2020-01-17T14:46:04Z")

</div>

You can set the document\_id based on the contents of the event. You will still be processing data multiple times with no added value, but the resulting records will be unique.

---

<div class="post-metadata">

**Author:** ![RITZ\_VERMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ritz_verma/32/46899_2.png) [@RITZ\_VERMA](https://discuss.elastic.co/u/RITZ_VERMA)\
**Post date:** [January 23, 2020, 6:44pm UTC](https://discuss.elastic.co/t/insert-all-records-of-a-table-in-mysql-with-no-unique-column-in-elastic-without-repitition/215377/3 "2020-01-23T18:44:13Z")

</div>

Thanks @Badger

---

<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:** [February 20, 2020, 6:44pm UTC](https://discuss.elastic.co/t/insert-all-records-of-a-table-in-mysql-with-no-unique-column-in-elastic-without-repitition/215377/4 "2020-02-20T18:44:15Z")

</div>

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