# Logstash - JDBC Plugin - \_\_$seqval

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-plugin-seqval/232525>\
**Category:** Logstash\
**Created:** [May 14, 2020, 12:35am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-seqval/232525 "2020-05-14T00:35:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LChand](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@LChand](https://discuss.elastic.co/u/LChand)\
**Post date:** [May 14, 2020, 12:35am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-seqval/232525/1 "2020-05-14T00:35:58Z")

</div>

Hello,

I'm able to connect to a SQL server DB and query a view from a Linux Logstash server. The CDC feature (Change Data Capture) is turned on on the SQL side and I'm trying to use the field \_\_$seqval for :sql\_last\_value. Although the initial compare is working with a hard coded value but the .logstash\_jdbc\_last\_run file isn't getting updated with the value so the subsequent runs aren't working..  
Pls note \_\_$seqval is binary data type and the value looks like 0x0003959B0005DF560004 in SQL Mgmt studio.

Below is the Initial run with the value:  
statement =\> "SELECT [**$seqval], [EMP\_ID] FROM View\_Name where [**$seqval] \> 0x0003959B0005DF560004 order by [**$seqval]"  
use\_column\_value =\> true  
tracking\_column =\> "**$seqval"  
last\_run\_metadata\_path =\> "/tmp/.logstash\_jdbc\_last\_run"

The value isn't in the file:  
cat /tmp/.logstash\_jdbc\_last\_run  
--- 0

Appreciate any suggestions you may have ...

Thanks

---

<div class="post-metadata">

**Author:** ![LChand](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@LChand](https://discuss.elastic.co/u/LChand)\
**Post date:** [May 14, 2020, 12:38am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-seqval/232525/2 "2020-05-14T00:38:55Z")

</div>

Pls note the \_\_ in \_\_$seqval got removed from the Select statement and the tracking column when I posted the question

---

<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:** [May 14, 2020, 1:05am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-seqval/232525/3 "2020-05-14T01:05:15Z")

</div>

I don't have an easy way to quote this, but you should read [this](https://discuss.elastic.co/t/how-to-grok-complex-patterns-with-logstash-7-1/218480/2). Learn a little bit of markdown if you want help.

---

<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:** [June 11, 2020, 1:05am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-seqval/232525/4 "2020-06-11T01:05:20Z")

</div>

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