# Select Only new entries from Mssql

**URL:** <https://discuss.elastic.co/t/select-only-new-entries-from-mssql/239268>\
**Category:** Logstash\
**Created:** [June 30, 2020, 10:04am UTC](https://discuss.elastic.co/t/select-only-new-entries-from-mssql/239268 "2020-06-30T10:04:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasmin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasmin/32/56586_2.png) [@Jasmin](https://discuss.elastic.co/u/Jasmin)\
**Post date:** [June 30, 2020, 10:04am UTC](https://discuss.elastic.co/t/select-only-new-entries-from-mssql/239268/1 "2020-06-30T10:04:33Z")

</div>

Hi,  
Logstash is listening to MSSQL using JBCD connector ,  
i want to make logstash select only new entires because i have millions of Tables , and select them all every time gonna make MSSQL so Slow .  
so How can i make logstash select only new entries and if no new entries don't select anything?

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [June 30, 2020, 10:13am UTC](https://discuss.elastic.co/t/select-only-new-entries-from-mssql/239268/2 "2020-06-30T10:13:01Z")

</div>

You need to have an id or timestamp in your MSSQL table that identifiy the record  
Then use sql\_last\_value param  
[https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#\_predefined\_parameters](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_predefined_parameters)

---

<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 28, 2020, 10:13am UTC](https://discuss.elastic.co/t/select-only-new-entries-from-mssql/239268/3 "2020-07-28T10:13:02Z")

</div>

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