# How to use Logstash automatically to store data from MySQL

**URL:** <https://discuss.elastic.co/t/how-to-use-logstash-automatically-to-store-data-from-mysql/44291>\
**Category:** Logstash\
**Created:** [March 14, 2016, 8:10am UTC](https://discuss.elastic.co/t/how-to-use-logstash-automatically-to-store-data-from-mysql/44291 "2016-03-14T08:10:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jemli\_Fathi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jemli_fathi/32/10714_2.png) [@Jemli\_Fathi](https://discuss.elastic.co/u/Jemli_Fathi)\
**Post date:** [March 14, 2016, 8:10am UTC](https://discuss.elastic.co/t/how-to-use-logstash-automatically-to-store-data-from-mysql/44291/1 "2016-03-14T08:10:30Z")

</div>

I used Logstash to load data from MySQL table into elasticsearch, but, the question is how can I configure logstash to do that automatically and to use it to store many tables or a whole database not a single table everytime.  
Thank you

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 14, 2016, 8:13am UTC](https://discuss.elastic.co/t/how-to-use-logstash-automatically-to-store-data-from-mysql/44291/2 "2016-03-14T08:13:58Z")

</div>

Using [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html)

---

<div class="post-metadata">

**Author:** ![Jemli\_Fathi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jemli_fathi/32/10714_2.png) [@Jemli\_Fathi](https://discuss.elastic.co/u/Jemli_Fathi)\
**Post date:** [March 14, 2016, 8:26am UTC](https://discuss.elastic.co/t/how-to-use-logstash-automatically-to-store-data-from-mysql/44291/3 "2016-03-14T08:26:47Z")

</div>

Many thanks, it's useful

---

<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:** [July 6, 2017, 5:07am UTC](https://discuss.elastic.co/t/how-to-use-logstash-automatically-to-store-data-from-mysql/44291/4 "2017-07-06T05:07:12Z")

</div>


