Open xvzf opened 4 years ago
The logstash-input-jdbc plugin has the statement_filepath
setting in the source code to import SQL statement file. So I think that it's a good idea to have similar function for this plugin.
# Path of file containing statement to execute
config :statement_filepath, :validate => :path
The statement (or statement_path) setting still holds the SQL statement but to use bind variables you must use the ? character as a placeholder in the exact order found in the prepared_statement_bind_values array. Some technologies may require connection string properties to be set, see MySQL example below.
Although the setting statement_path
is mentioned in the doc, this plugin does not seem to have this function.
Since all JDBC related plugins are in the phase of merge into logstash-integration-jdbc to share the common part of the code base, probably the best is to move this issue in that repository
Wherever it appears it must to have this feature, IMHO.
Whenever there are large and complex queries it would be nice to load them from a file instead of having a multi-line SQL-Statement in the config file. This would also eliminate the annoyance of escaped quotes when using PostgreSQL and
jsonb
queries