# How to maintain sql\_last\_value for different source queries

**URL:** <https://discuss.elastic.co/t/how-to-maintain-sql-last-value-for-different-source-queries/298812>\
**Category:** Elasticsearch\
**Created:** [March 4, 2022, 4:43am UTC](https://discuss.elastic.co/t/how-to-maintain-sql-last-value-for-different-source-queries/298812 "2022-03-04T04:43:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbnalluri](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rbnalluri](https://discuss.elastic.co/u/rbnalluri)\
**Post date:** [March 4, 2022, 4:43am UTC](https://discuss.elastic.co/t/how-to-maintain-sql-last-value-for-different-source-queries/298812/1 "2022-03-04T04:43:31Z")

</div>

Hi,  
I have couple of scripts which reads data from oracle database and creates respective index files on Elasticsearch.I have implemented delta extraction logic by using the inbuilt feature of logstash by using :sql\_last\_value. Now the problem is I have only one file which stores the value of sql\_last\_value and for each execution of different source queries the sql\_last\_value of previous executed query is used and at the end current query value is being stored. Is there any way that sql\_last\_value can be stored exclusively for each extraction script we running?

Please advise.  
Thanks,  
Rajendra Nalluri.

---

<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 18, 2022, 4:43am UTC](https://discuss.elastic.co/t/how-to-maintain-sql-last-value-for-different-source-queries/298812/2 "2022-03-18T04:43:54Z")

</div>

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