# How to implement listener for log file and database

**URL:** <https://discuss.elastic.co/t/how-to-implement-listener-for-log-file-and-database/84152>\
**Category:** Logstash\
**Created:** [May 1, 2017, 1:00pm UTC](https://discuss.elastic.co/t/how-to-implement-listener-for-log-file-and-database/84152 "2017-05-01T13:00:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonal410](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonal410/32/17825_2.png) [@sonal410](https://discuss.elastic.co/u/sonal410)\
**Post date:** [May 1, 2017, 1:00pm UTC](https://discuss.elastic.co/t/how-to-implement-listener-for-log-file-and-database/84152/1 "2017-05-01T13:00:07Z")

</div>

I have to update elasticsearch with each new entry in log file and each new record inserted in rdbms database, is their any way for that. I was able to migrate data once but now sure how to do it for any further change in log file and database

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 3, 2017, 5:07am UTC](https://discuss.elastic.co/t/how-to-implement-listener-for-log-file-and-database/84152/2 "2017-05-03T05:07:48Z")

</div>

The file input is made for continuous monitoring of a log file which is exactly what you're looking for.

Use the jdbc input for reading from your relational database. It can be configured to run on a schedule. There are a couple of ways to avoid duplicate insertions from the database. At least one of the methods is described in the plugin documentation.

---

<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:** [May 31, 2017, 5:18am UTC](https://discuss.elastic.co/t/how-to-implement-listener-for-log-file-and-database/84152/3 "2017-05-31T05:18:05Z")

</div>

Closed on May 31, 2017, 5:18am UTC

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