# Incremental Refresh

**URL:** <https://discuss.elastic.co/t/incremental-refresh/76102>\
**Category:** Logstash\
**Created:** [February 22, 2017, 8:08pm UTC](https://discuss.elastic.co/t/incremental-refresh/76102 "2017-02-22T20:08:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tausif786](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@tausif786](https://discuss.elastic.co/u/tausif786)\
**Post date:** [February 22, 2017, 8:08pm UTC](https://discuss.elastic.co/t/incremental-refresh/76102/1 "2017-02-22T20:08:11Z")

</div>

Hello Everyone,  
I am new to ELK Stack.

I have data in postgresql which i need to do some visualizations in Kibana.  
Steps i have followed

Creating a logstash config file which reads data from postgresql and pushes it in elasticsearch, below is the config file.

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:postgresql://localhost:5432/dvdrental"  
jdbc\_user =\> "postgres"  
jdbc\_password =\> "123456"  
jdbc\_validate\_connection =\> true  
jdbc\_driver\_library =\> "C:\kabana\logstash-5.1.2\logstash-5.1.2\drivers\postgresql-9.4-1200-jdbc41.jar"  
jdbc\_driver\_class =\> "org.postgresql.Driver"  
statement =\> "SELECT \* from public.address"  
}  
}  
output {  
elasticsearch {  
#protocol =\> http  
index =\> "address\_table"  
document\_type =\> "address"  
document\_id =\> "%{address\_id}"  
hosts =\> ["localhost:9200"]  
}  
}

i am successful in loading data from PostgreSQL to elastic search.  
but what i want is an incremental refresh, such that when new data is loaded in the PostgreSQL table only the new data should be added in elasticsearch through logstash and the data loading should happen every hour.(Like appending the new data to existing data in elasticsearch)  
Please help me with the same.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 23, 2017, 7:07am UTC](https://discuss.elastic.co/t/incremental-refresh/76102/2 "2017-02-23T07:07:26Z")

</div>

Have you read what's said about `sql_last_value` in the jdbc input documentation?

---

<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:** [March 23, 2017, 7:07am UTC](https://discuss.elastic.co/t/incremental-refresh/76102/3 "2017-03-23T07:07:28Z")

</div>

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