# Delay in getting the data from postgresql

**URL:** <https://discuss.elastic.co/t/delay-in-getting-the-data-from-postgresql/56000>\
**Category:** Logstash\
**Created:** [July 20, 2016, 3:22pm UTC](https://discuss.elastic.co/t/delay-in-getting-the-data-from-postgresql/56000 "2016-07-20T15:22:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggp](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@ggp](https://discuss.elastic.co/u/ggp)\
**Post date:** [July 20, 2016, 3:22pm UTC](https://discuss.elastic.co/t/delay-in-getting-the-data-from-postgresql/56000/1 "2016-07-20T15:22:41Z")

</div>

I am seeing delay in getting the data from postgresql, here is the configuration i have

> input {  
> jdbc {  
> # Postgres jdbc connection string to our database, mydb  
> jdbc\_connection\_string =\> "jdbc:postgresql://\<\>:5432/svcpgst"  
> # The user we wish to execute our statement as  
> jdbc\_user =\> "user"  
> jdbc\_password=\>"user"  
> # The path to our downloaded jdbc driver  
> jdbc\_driver\_library =\> "/root/software/postgresql-9.4.1208.jar"  
> # The name of the driver class for Postgresql  
> jdbc\_driver\_class =\> "org.postgresql.Driver"  
> #sql\_log\_level =\> "debug"  
> jdbc\_paging\_enabled =\> "true"  
> jdbc\_page\_size =\> "5000"  
> schedule =\> "\* \* \* \* \*"  
> # our query  
> clean\_run =\> true  
> last\_run\_metadata\_path =\> "/apps/logstash/.actmon\_metadata"  
> use\_column\_value =\> true  
> tracking\_column =\> id  
> statement =\> "SELECT id,global\_transaction\_id,service\_name,status,date\_time from transaction\_monitor where id \> :sql\_last\_value"  
> }  
> }

the scheduler is `schedule => "* * * * *"`, The records are getting generated in PostgreSQL DB but they are showing up after 30/45 minutes in ES, anything wrong with the above config, also how we can check what queries are getting executed at any interval,

---

<div class="post-metadata">

**Author:** ![PhaedrusTheGreek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phaedrusthegreek/32/4884_2.png) [@PhaedrusTheGreek](https://discuss.elastic.co/u/PhaedrusTheGreek)\
**Post date:** [July 20, 2016, 3:42pm UTC](https://discuss.elastic.co/t/delay-in-getting-the-data-from-postgresql/56000/2 "2016-07-20T15:42:14Z")

</div>

@ggp,

For debugging purposes, please try outputting locally so that we can remove Elasticsearch from the equation for now.

```auto
output {
 elasticsearch {
  ... 
 }
 #debugging
 stdout { }
 file {
   path => "./debug-output"
 }
 #end debugging
}

```

Let me know if you see the same delay locally.

---

<div class="post-metadata">

**Author:** ![ggp](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@ggp](https://discuss.elastic.co/u/ggp)\
**Post date:** [July 20, 2016, 5:03pm UTC](https://discuss.elastic.co/t/delay-in-getting-the-data-from-postgresql/56000/3 "2016-07-20T17:03:29Z")

</div>

i see delay locally as well....do you know how we log any running queries

---

<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:** [July 6, 2017, 4:47am UTC](https://discuss.elastic.co/t/delay-in-getting-the-data-from-postgresql/56000/4 "2017-07-06T04:47:12Z")

</div>


