# Data Update from MYSQL not appear

**URL:** <https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512>\
**Category:** Logstash\
**Created:** [November 5, 2019, 3:00am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512 "2019-11-05T03:00:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dean92](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dean92](https://discuss.elastic.co/u/dean92)\
**Post date:** [November 5, 2019, 3:00am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512/1 "2019-11-05T03:00:17Z")

</div>

hi all,

I have one problem on my data. I export one table and a few column on my MYSQL to ES using logstash. there are one column(status\_ticket) in table is frequently change e.g: from status new to open/closed and it effective to every row in table. first time i push config, the data look fine and tally with my DB but after a few moment i release, in DB that column(status\_ticket) already change value but in Kibana, data still remain as first time i load. The only changes in my data at Kibana happen when there are new entry registered in my DB because i put id as :sql\_last\_value.

here my config:

input {  
jdbc {  
jdbc\_driver\_library =\> "C:\Program Files\mysql-connector-java-8.0.17\mysql-connector-java-8.0.17.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/nex?useTimezone=true&serverTimezone=UTC"  
jdbc\_user =\> "root"  
jdbc\_password =\> ""  
schedule =\> "\* \* \* \* \*"  
statement =\> "SELECT id, id\_ticket, cause\_of\_fault, created\_date, Portion FROM td\_ticket\_closed WHERE id \> :sql\_last\_value"  
use\_column\_value =\> true  
tracking\_column =\> "id"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "nexdesk-test"  
}  
stdout {}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 5, 2019, 5:46am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512/2 "2019-11-05T05:46:19Z")

</div>

The query you are using need to be able to show the changes when run repeatedly. If I am reading your SQL query correctly you are only fetching new rows as you are looking for only new `id`s. If you want updates captured you probably need to add a last updated timestamp and use this with your `sql_last_value` condition instead.

---

<div class="post-metadata">

**Author:** ![dean92](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dean92](https://discuss.elastic.co/u/dean92)\
**Post date:** [November 5, 2019, 8:48am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512/3 "2019-11-05T08:48:08Z")

</div>

it is possible if I used more that one tracking column?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 5, 2019, 9:38am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512/4 "2019-11-05T09:38:46Z")

</div>

No, I do not see that being a possibility.

---

<div class="post-metadata">

**Author:** ![dean92](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@dean92](https://discuss.elastic.co/u/dean92)\
**Post date:** [November 7, 2019, 3:07am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512/5 "2019-11-07T03:07:53Z")

</div>

I have one column with name update\_date but i my table structure shown in varchar format. I try to use it as sql\_last\_ value but now my data duplicate every minutes.

input {  
jdbc {  
jdbc\_driver\_library =\> "C:\Program Files\mysql-connector-java-8.0.17\mysql-connector-java-8.0.17.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/nex?useTimezone=true&serverTimezone=UTC"  
jdbc\_user =\> "root"  
jdbc\_password =\> ""  
schedule =\> "\* \* \* \* \*"  
statement =\> "SELECT id, id\_ticket, cause\_of\_fault, created\_date, Portion, updated\_date FROM td\_ticket\_closed WHERE updated\_date \> :sql\_last\_value"  
use\_column\_value =\> true  
tracking\_column =\> "updated\_date"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "nexdesk-test"  
}  
stdout {}

---

<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:** [December 5, 2019, 3:07am UTC](https://discuss.elastic.co/t/data-update-from-mysql-not-appear/206512/6 "2019-12-05T03:07:54Z")

</div>

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