title: Connect to multiple databases dynamically using Logstash JDBC Input plugin
body: <p>I am using Logstash JDBC input plugin to read data from database and index it into Elastic Search. 
  I have separate database for each customer and I want to connect to them one by one dynamically to fetch data? </p>
  
  <p><strong>Is there any provision or parameter in JDBC-Input Plugin or Logstash to connect to multiple databases?</strong></p>
  
  <p><strong>e.g</strong> </p>
  
  <pre><code>input {
    jdbc {
      jdbc_driver_library =&gt; "mysql-connector-java-5.1.36-bin.jar"
      jdbc_driver_class =&gt; "com.mysql.jdbc.Driver"
      jdbc_connection_string =&gt; "jdbc:mysql://localhost:3306/MYDB"
      //MYDB will be set dynamically. 
      jdbc_user =&gt; "mysql"
      parameters =&gt; { "favorite_artist" =&gt; "Beethoven" }
      schedule =&gt; "* * * * *"
      statement =&gt; "SELECT * from songs where artist = :favorite_artist"
    }
  }
  </code></pre>
  
  <p><strong>Only solution I can think of</strong> is writing script that will update logstash config to connect to specified databases one by one and run logstash through it.</p>