# Didn't immediately reflect or update the elasticsearch have insert last record data in table through logstash

**URL:** https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820
**Category:** Logstash
**Created:** [October 24, 2018, 1:53pm UTC](https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820 "2018-10-24T13:53:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![karthick\_tgi](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@karthick\_tgi](https://discuss.elastic.co/u/karthick_tgi)
#### Post date: [October 24, 2018, 1:53pm UTC](https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820/1 "2018-10-24T13:53:04Z")

</div>

Using logstash 6.4.2

I have using the statement on select query for **last insert the data** in table.

I run with a schedule ( schedule =\> "\* \* \* \* \*" ) for logstash instead of running,but the data is didn't update or reflect immediately in elasticsearch, once I will **stop logstash** reflected or updated the data in elasticsearch.

If you have any solutions?

---

<div class="post-metadata">

### Author: ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)
#### Post date: [October 25, 2018, 8:11am UTC](https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820/2 "2018-10-25T08:11:35Z")

</div>

hope this helps you

this expression works fine, for every 1minute, it will take the data from the database  
schedule =\> "\*/1 \* \* \* \*"

The input code is as follows

input {

jdbc {  
jdbc\_driver\_library =\> "D:/Softwares/logstash-6.4.2/lib/com.mysql.jdbc\_5.1.5.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/test"  
jdbc\_user =\> "root"  
jdbc\_password =\> "root"  
statement =\> "SELECT \* FROM sample"  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "50000"  
schedule =\> "\*/1 \* \* \* \*"  
}

}

output{  
elasticsearch { codec =\> json hosts =\> ["localhost:9200"] index =\> "sqldata" }  
stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

### Author: ![karthick\_tgi](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@karthick\_tgi](https://discuss.elastic.co/u/karthick_tgi)
#### Post date: [October 29, 2018, 9:08am UTC](https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820/3 "2018-10-29T09:08:27Z")

</div>

Thanks for response ,  
The above method **i tried is working fine** , but i need last insert the data only update in database and it will reflect in elastic.  
I think update data it can be stored in **logstash** buffer and it's take some hours it will reflected automatically in elastic. Here i need **immediately** reflect in elastic.. **Is there any solutions for it?**  
I tried **logstash.yml** file changes lot of things it's **not working**..

---

<div class="post-metadata">

### Author: ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)
#### Post date: [October 29, 2018, 9:26am UTC](https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820/4 "2018-10-29T09:26:29Z")

</div>

> [@karthick\_tgi](#):
>
> **immediately** reflect in elastic.. **Is there any solutions for it?**

we must use pattern to update the data for every second in "schedule"

---

<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: [November 26, 2018, 9:26am UTC](https://discuss.elastic.co/t/didnt-immediately-reflect-or-update-the-elasticsearch-have-insert-last-record-data-in-table-through-logstash/153820/5 "2018-11-26T09:26:31Z")

</div>

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