例如,我有8个dbs,例如db0
,db1
,db2
,...,db7
。
在每个数据库中,我有近1024个表共享相同的结构,表的名称为table0001
,table0002
,table0003
,...,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_library
,jdbc_driver_class
等。
是否有像通配符这样的机制来避免冗余配置?特别是在分裂表情况下使用时。