How to use Logstash automatically to store data from MySQL

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

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

Many thanks, it's useful