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

Add ability to read query from file to postgresql_extensible #6242

Closed
buggsdummy opened this issue Aug 12, 2019 · 2 comments · Fixed by #6361
Closed

Add ability to read query from file to postgresql_extensible #6242

buggsdummy opened this issue Aug 12, 2019 · 2 comments · Fixed by #6361
Assignees
Labels
area/postgresql feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@buggsdummy
Copy link

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

Add ability to pass in parameter to sql file location

Current behavior:

sqlquery="SELECT * FROM pg_stat_database where datname"

Desired behavior:

sqlquery=/var/tmp/sqlfile.sql

Use case:

This would help greatly on servers that have multiple long queries instead of putting it into sqlquery which could get really large

@danielnelson danielnelson added area/postgresql feature request Requests for new plugin and for new features to existing plugins labels Aug 13, 2019
@danielnelson danielnelson changed the title Feature Request: Add ability to read sql file Add ability to read query from file to postgresql_extensible Aug 13, 2019
@Zyqsempai
Copy link
Contributor

I can take this one, if the feature is approved.

@danielnelson
Copy link
Contributor

Thanks @Zyqsempai, this would be good to have. I think add a new script option and if both script and sqlquery are set then produce an error:

  [[inputs.postgresql_extensible.query]]
    script = "/var/tmp/sqlfile.sql"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/postgresql feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants