# Update elastic search document

**URL:** https://discuss.elastic.co/t/update-elastic-search-document/228102
**Category:** Logstash
**Created:** [April 15, 2020, 11:36am UTC](https://discuss.elastic.co/t/update-elastic-search-document/228102 "2020-04-15T11:36:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hariskhalique](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@hariskhalique](https://discuss.elastic.co/u/hariskhalique)
#### Post date: [April 15, 2020, 11:36am UTC](https://discuss.elastic.co/t/update-elastic-search-document/228102/1 "2020-04-15T11:36:37Z")

</div>

Hi,  
I have create following conf file

> ```
> input {
> jdbc {
> jdbc_driver_library => "/usr/share/java/mysql.jar"
> jdbc_driver_class => "com.mysql.jdbc.Driver"
> jdbc_connection_string => "jdbc:mysql://localhost:3309/v4qadb"
> jdbc_user => "v4qashop"
> jdbc_password => "V4admin09&#!"
> jdbc_paging_enabled => true
> jdbc_page_size => 10000
> tracking_column => "pro_updated_date"
> use_column_value=>true
> # statement => "select * from `es_product_detail_info` where `pro_updated_date` >=:sql_last_value"
> schedule => "*/10 * * * *"
> statement => "SELECT
> `item_id`,`product_id`,`item_color_id`,`item_size_id`,`item_sku`,`item_image`,`item_price`,`brand_id`,`control_number`,`description`,
> `display_product_color_id`,`item_details`,`item_name`,`gender`,`pro_updated_date` ,`shopify_product_id`,`image_product_name`,`image_sort_order`,
> `image_title`,`image_id`,`updated_at`,`document_id`,`item_color_image`,`item_v4_size_title`,`cat_name`,`cat_shopify_collection_id`
> from es_product_info where `pro_updated_date` >=:sql_last_value"
> }
> }
> output {
> elasticsearch {
> document_id=> "%{document_id}"
> document_type => "doc"
> index => "product_detail_info"
> hosts => ["http://localhost:9200"]
> }
> stdout{
> codec => rubydebug
> }
> }
> 
> ```

My tracking column is base on date. My question is if I change any thing in mysql table and also update "pro\_updated\_date" to current date it should update document right ?

If not then how I can achieve this ? And I want to update on real time.My logstash running in background.

Should I have to create separate conf file for update ?

Thanks in Advance.

---

<div class="post-metadata">

### Author: ![hariskhalique](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@hariskhalique](https://discuss.elastic.co/u/hariskhalique)
#### Post date: [April 15, 2020, 2:38pm UTC](https://discuss.elastic.co/t/update-elastic-search-document/228102/2 "2020-04-15T14:38:28Z")

</div>

Guys I need your help. How we change logstash timestamp so that it matches my server ?

---

<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: [May 13, 2020, 2:38pm UTC](https://discuss.elastic.co/t/update-elastic-search-document/228102/3 "2020-05-13T14:38:35Z")

</div>

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