# How to fetch SQL incremental data

**URL:** <https://discuss.elastic.co/t/how-to-fetch-sql-incremental-data/118337>\
**Category:** Logstash\
**Created:** [February 4, 2018, 10:35am UTC](https://discuss.elastic.co/t/how-to-fetch-sql-incremental-data/118337 "2018-02-04T10:35:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shridhar](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@shridhar](https://discuss.elastic.co/u/shridhar)\
**Post date:** [February 4, 2018, 10:35am UTC](https://discuss.elastic.co/t/how-to-fetch-sql-incremental-data/118337/1 "2018-02-04T10:35:16Z")

</div>

Hi I need help to fetch SQL incremental data using log stash6.1.2..

There is no id field in SQL table and we have to achieve this combining 2 columns hostname & sampletime which will be unique all the time

---

<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:** [February 4, 2018, 10:07pm UTC](https://discuss.elastic.co/t/how-to-fetch-sql-incremental-data/118337/2 "2018-02-04T22:07:13Z")

</div>

You don't need an id column, but you do need a column or set of columns that you can add to a condition to select only those rows that have changed since last time. Wouldn't the sample time column do?

---

<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 4, 2018, 10:07pm UTC](https://discuss.elastic.co/t/how-to-fetch-sql-incremental-data/118337/3 "2018-03-04T22:07:45Z")

</div>

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