Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for loading query from file #39

Open
xvzf opened this issue Jan 12, 2020 · 3 comments
Open

Support for loading query from file #39

xvzf opened this issue Jan 12, 2020 · 3 comments

Comments

@xvzf
Copy link

xvzf commented Jan 12, 2020

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

@LuckyWindsck
Copy link

LuckyWindsck commented Jan 27, 2020

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.

@andsel
Copy link

andsel commented Jan 29, 2020

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

@az-joss
Copy link

az-joss commented Jun 18, 2024

Wherever it appears it must to have this feature, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants