logstash jdbc上的多个输入用于mysql集群

时间:2018-01-05 02:59:32

标签: elasticsearch logstash logstash-configuration logstash-jdbc

例如,我有8个dbs,例如db0db1db2,...,db7。 在每个数据库中,我有近1024个表共享相同的结构,表的名称为table0001table0002table0003,...,table1024。 据我所知,对于每个数据库和表,必须有一个jdbc配置对应它。例如,

input {
      jdbc {
        jdbc_driver_library => "mysql-connector-java-5.1.39-bin.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql://localhost:3306/db0"
        jdbc_user => "root"
        jdbc_password => "password"
        schedule => "* * * * *"
        statement => "select * from table0001"
        type => "table0001"
      }
      jdbc {
        jdbc_driver_library => "mysql-connector-java-5.1.39-bin.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql://localhost:3306/db0"
        jdbc_user => "root"
        jdbc_password => "password"
        schedule => "* * * * *"
        statement => "select * from table0002"
        type => "table0002"
      }
      ...
      jdbc {
        jdbc_driver_library => "mysql-connector-java-5.1.39-bin.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql://localhost:3306/db0"
        jdbc_user => "root"
        jdbc_password => "password"
        schedule => "* * * * *"
        statement => "select * from table1024"
        type => "table1024"
      }

    }

有许多冗余配置,例如jdbc_driver_libraryjdbc_driver_class等。

是否有像通配符这样的机制来避免冗余配置?特别是在分裂表情况下使用时。

0 个答案:

没有答案