0

例如,我有 8 个分贝,例如db0, db1, db2, ... , db7. 在每个数据库中,我有近 1024 个表共享相同的结构,表的名称是table0001, table0002, table0003,..., table1024。据我所知,对于每个 db 和 table,都必须有一个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等等。

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

4

0 回答 0