# JDBC input scheduling question

**URL:** <https://discuss.elastic.co/t/jdbc-input-scheduling-question/52268>\
**Category:** Logstash\
**Created:** [June 9, 2016, 2:25am UTC](https://discuss.elastic.co/t/jdbc-input-scheduling-question/52268 "2016-06-09T02:25:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daq/32/33426_2.png) [@daq](https://discuss.elastic.co/u/daq)\
**Post date:** [June 9, 2016, 2:25am UTC](https://discuss.elastic.co/t/jdbc-input-scheduling-question/52268/1 "2016-06-09T02:25:26Z")

</div>

I added a jdbc input to my config files:

```
input {
  jdbc {
    jdbc_driver_library => "/usr/share/java/postgresql94-jdbc.jar"
    jdbc_driver_class => "org.postgresql.Driver"
    jdbc_connection_string => "jdbc:postgresql://psqlhost:5432/mydb"
    jdbc_user => "myuser"
    jdbc_password => "mypass"
    jdbc_validate_connection => "true"
    # schedule => "* 6 * * *"
    statement => "select stuff from table"
    add_field => {
      "index" => "jdbc"
      "type" => "RequestCreated"
    }
  }
}

```

And the following ES output config:

```
output {
  if [type] == "RequestCreated" {
    elasticsearch {
      hosts => ["localhost"]
      index => "%{index}-%{+YYYY.MM.dd}"
      document_type => "%{type}"
      document_id => "%{requestid}"
    }
  }
}

```

I also created an index using a field from my DB table that gets updated every time a record gets updated.

As far as I can understand, this SELECT should only run once, but I keep seeing new data in Kibana. Where is it coming from? Is there a default schedule? Documentation says when no schedule is specified, SELECT will only run on logstash restart.

Thanks.

---

<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:53am UTC](https://discuss.elastic.co/t/jdbc-input-scheduling-question/52268/2 "2017-07-06T04:53:59Z")

</div>


