# What field to save the state of the logs for Logstash JDBC input plugin?

**URL:** <https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600>\
**Category:** Logstash\
**Created:** [July 15, 2019, 7:02pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600 "2019-07-15T19:02:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 15, 2019, 7:02pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600/1 "2019-07-15T19:02:59Z")

</div>

Is there any way to save the state of the logs in Logstash JDBC input plugin?

For example, for file input plugin, there is [`sincedb_path`](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-sincedb_path) which remembers where it left off from reading the logs.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 15, 2019, 8:15pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600/2 "2019-07-15T20:15:23Z")

</div>

Yes, the jdbc input can persist [state](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_state).

---

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 15, 2019, 9:16pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600/3 "2019-07-15T21:16:35Z")

</div>

I'm not sure what value to include for sql\_last\_value as JDBC state. Coud you please clarify this?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 15, 2019, 9:29pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600/4 "2019-07-15T21:29:24Z")

</div>

Look at the documentation for the tracking\_column, tracking\_column\_type and use\_column\_value on the jdbc input. If you search in [this forum](https://discuss.elastic.co/search?q=sql_last_value%20category%3A14%20use_tracking_column) you will find many examples of people using them.

---

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 17, 2019, 11:10pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600/5 "2019-07-17T23:10:39Z")

</div>

Thank you!

---

<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:** [August 14, 2019, 11:10pm UTC](https://discuss.elastic.co/t/what-field-to-save-the-state-of-the-logs-for-logstash-jdbc-input-plugin/190600/6 "2019-08-14T23:10:52Z")

</div>

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