# How Logstash sync work?

**URL:** https://discuss.elastic.co/t/how-logstash-sync-work/369868
**Category:** Logstash
**Created:** [October 31, 2024, 9:31am UTC](https://discuss.elastic.co/t/how-logstash-sync-work/369868 "2024-10-31T09:31:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Coftbred](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/coftbred/32/137542_2.png) [@Coftbred](https://discuss.elastic.co/u/Coftbred)
#### Post date: [October 31, 2024, 9:31am UTC](https://discuss.elastic.co/t/how-logstash-sync-work/369868/1 "2024-10-31T09:31:43Z")

</div>

I am new to Elasticsearch and Logstash, I want to know how Logstash can Sync data with Elasticsearch, for example, what mechanism does Logstash have to recognize a changed data field or just scan the entire database every time it is scheduled?

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [November 5, 2024, 12:09pm UTC](https://discuss.elastic.co/t/how-logstash-sync-work/369868/2 "2024-11-05T12:09:32Z")

</div>

Hi @Coftbred,

Welcome! I assume you're specifically talking about the [JDBC input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html) that can be used to ingest data from a database into Elasticsearch?

You'll see from the example in the documentation that you set a cron schedule to poll the database using the specified SQL statement. There's a bit of commentary on the state in there too, but you can also [check out the code](https://github.com/logstash-plugins/logstash-integration-jdbc/tree/v5.5.0) if you want to understand the nitty-gritty of the implementation.

Hope that helps!
