# Data not updating automatically when I change my MySQL table

**URL:** <https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536>\
**Category:** Kibana\
**Created:** [May 20, 2021, 12:46pm UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536 "2021-05-20T12:46:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablixelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablixelastic/32/89018_2.png) [@pablixelastic](https://discuss.elastic.co/u/pablixelastic)\
**Post date:** [May 20, 2021, 12:46pm UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/1 "2021-05-20T12:46:07Z")

</div>

Hi!

I'm having some issues at the moment of updating my data in Kibana when I change any info from MySQL table.  
I don't really know if it's possible.  
Can someone help me?

Thanks!

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [May 20, 2021, 6:03pm UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/2 "2021-05-20T18:03:26Z")

</div>

Hello,

How are you connecting the data from your MySQL table? I am assuming you are connecting to ES and then you are trying to find that data in Kibana?  
Can you see that changed data in your elasticsearch directly?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![pablixelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablixelastic/32/89018_2.png) [@pablixelastic](https://discuss.elastic.co/u/pablixelastic)\
**Post date:** [May 21, 2021, 7:24am UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/3 "2021-05-21T07:24:23Z")

</div>

Hello,

I'm connecting the data from MySQL via logstash with this configuration:

input {  
jdbc {  
clean\_run =\> true  
jdbc\_driver\_library =\> "C:\Users\admpablos\Documents\Elastic\logstash-7.12.1\mysql-connector-java-5.1.44-bin.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/MY\_BBDD?useSSL=false"  
jdbc\_user =\> "root"  
jdbc\_password =\> "MY\_PASSWORD"  
schedule =\> "\*/5 \* \* \* \* \*"  
statement =\> "SELECT \* from MY\_TABLE WHERE ID \> :sql\_last\_value"  
use\_column\_value =\> true  
tracking\_column =\> "id"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "MY\_INDEX"  
user =\> "elastic"  
password =\> "MY\_PASSWORD"  
}  
stdout{ codec =\> rubydebug }  
}

I guess there is something wrong with this config.  
When i add any line to my MySQL table, the Data Table in Kibana is updating perfectly. The problem comes when i modify any data from any existing line of the MySQL table. This modification is not seen in the Data Table of Kibana.

Thank you for your time Bhavya!

---

<div class="post-metadata">

**Author:** ![pablixelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablixelastic/32/89018_2.png) [@pablixelastic](https://discuss.elastic.co/u/pablixelastic)\
**Post date:** [May 25, 2021, 12:46pm UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/4 "2021-05-25T12:46:36Z")

</div>

Can someone help me? I don't really know if ES is able to make this function.

Thank you!

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [May 25, 2021, 5:34pm UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/5 "2021-05-25T17:34:13Z")

</div>

Hi,

I don't think LogStash is the problem here: If you update an existing entry the ID is not changed, right? But you told LogStash to store the last read entry Id so existing entries are never read again.

I think you have to change the logic to use a last modification date for this and make sure that this is changed every time the entry is updated. Then, you have to configure the elasticsearch output to use your id column as document id - otherwise a modified entry would create a new entry instead of updating the existing entry.

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![pablixelastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablixelastic/32/89018_2.png) [@pablixelastic](https://discuss.elastic.co/u/pablixelastic)\
**Post date:** [May 26, 2021, 9:25am UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/6 "2021-05-26T09:25:05Z")

</div>

Thanks you a lot Wolfram,

I'll try to make this changes. If i succed i'll post the code here.

---

<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 23, 2021, 9:25am UTC](https://discuss.elastic.co/t/data-not-updating-automatically-when-i-change-my-mysql-table/273536/7 "2021-06-23T09:25:31Z")

</div>

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