input {
jdbc {
jdbc_connection_string => "jdbc:sqlserver://ip_address:1433;databaseName=database_name;encrypt=true;trustServerCertificate=true;"
jdbc_user => "userxxxx"
jdbc_password => "passxxxx"
jdbc_driver_library => "logstash-core/lib/jars/mssql-jdbc-12.2.0.jre8.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
statement => "SELECT * FROM DeviceLogs_5_2023 WHERE DeviceLogId > :sql_last_value ORDER BY DeviceLogId ASC"
schedule => "* * * * *"
tracking_column => "devicelogid"
use_column_value => true
type => "devicelogs"
}
}
Here, in statement table name is DeviceLogs_5_2023. But it will change according to the present month and year.
Is there any way to make the name of table name in statement dynamically?
Or any other methods?