How should I use sql_last_value in logstash?
<p>I'm quite unclear of what <code>sql_last_value</code> does when I give my statement as such:</p>

<pre><code>statement =&gt; "SELECT * from mytable where id &gt; :sql_last_value"
</code></pre>

<p>I can slightly understand the reason behind using it, where it doesn't browse through the whole db table in order to update fields instead it only updates the records which were added newly. Correct me if I'm wrong.</p>

<p>So what I'm trying to do is, creating the index using <code>logstash</code> as such:</p>

<pre><code>input {
    jdbc {
        jdbc_connection_string =&gt; "jdbc:mysql://hostmachine:3306/db" 
        jdbc_user =&gt; "root"
        jdbc_password =&gt; "root"
        jdbc_validate_connection =&gt; true
        jdbc_driver_library =&gt; "/path/mysql_jar/mysql-connector-java-5.1.39-bin.jar"
        jdbc_driver_class =&gt; "com.mysql.jdbc.Driver"
        schedule =&gt; "* * * * *"
        statement =&gt; "SELECT * from mytable where id &gt; :sql_last_value"
        use_column_value =&gt; true
        tracking_column =&gt; id
        jdbc_paging_enabled =&gt; "true"
        jdbc_page_size =&gt; "50000"
    }
}

output {
    elasticsearch {
        #protocol =&gt; http
        index =&gt; "myindex"
        document_type =&gt; "message_logs"
        document_id =&gt; "%{id}"
        action =&gt; index
        hosts =&gt; ["http://myhostmachine:9402"]
    }
}
</code></pre>

<p>Once I do this, the docs aren't getting uploaded at all to the index. Where am I going wrong?</p>

<p>Any help could be appreciated.</p>