# Config JDBC input to only get new logs from MySQL

**URL:** <https://discuss.elastic.co/t/config-jdbc-input-to-only-get-new-logs-from-mysql/172509>\
**Category:** Logstash\
**Created:** [March 15, 2019, 10:32am UTC](https://discuss.elastic.co/t/config-jdbc-input-to-only-get-new-logs-from-mysql/172509 "2019-03-15T10:32:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thangld](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thangld/32/82551_2.png) [@thangld](https://discuss.elastic.co/u/thangld)\
**Post date:** [March 15, 2019, 10:32am UTC](https://discuss.elastic.co/t/config-jdbc-input-to-only-get-new-logs-from-mysql/172509/1 "2019-03-15T10:32:15Z")

</div>

Hello everyone,  
I'm trying to use logstash to get logs from MySQL server.  
It keeps getting every logs every minute. This is my config for jdbc:

```auto
jdbc {
        clean_run => true
        jdbc_connection_string => "jdbc:mysql://localhost:3306/mysql?user=root"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_driver_library => "/etc/logstash/mysql-connector-java-5.1.36.jar"
        jdbc_user => "root"
        schedule => "* * * * *"
        statement => "SELECT * from logs where product = 'vnac'"
    }

```

How can I config JDBC to get the new logs only?  
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:** [April 12, 2019, 10:45am UTC](https://discuss.elastic.co/t/config-jdbc-input-to-only-get-new-logs-from-mysql/172509/2 "2019-04-12T10:45:55Z")

</div>

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