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

inputs.exec, inputs.execd: add an option to pass a custom environment to their child process #9281

Closed
micoq opened this issue May 20, 2021 · 3 comments · Fixed by #11049
Closed
Labels
area/exec area/execd Issues related to execd or plugins that would be better suited to be used through execd feature request Requests for new plugin and for new features to existing plugins

Comments

@micoq
Copy link

micoq commented May 20, 2021

Feature Request

Proposal:

Add an option in inputs.exec and inputs.execd to pass custom environment variables to their child process.

Current behavior:

Currently, if you want to pass some values to the child process, you can only use the command line parameters or the whole environment of Telegraf.

Desired behavior:

For inputs.execd, there is always a single command so we could have an option like this:

[[inputs.execd]]

command = ["/path/to/my/process"]

[inputs.execd.env]
CUSTOM_VAR_1 = "var1"
CUSTOM_VAR_2 = "var2"
CUSTOM_VAR_2 = "var3"

Use case:

This can be useful to easily customize the child process behavior without having a separate configuration file and not display this information in the command line (e.g. for credentials)

@micoq micoq added the feature request Requests for new plugin and for new features to existing plugins label May 20, 2021
@ssoroka
Copy link
Contributor

ssoroka commented May 20, 2021

This is a good idea. 👍🏼

@ssoroka ssoroka added the area/execd Issues related to execd or plugins that would be better suited to be used through execd label May 20, 2021
@rajiv-k
Copy link
Contributor

rajiv-k commented May 21, 2021

I'd like to take this up.

@ssoroka
Copy link
Contributor

ssoroka commented May 25, 2021

@rajiv-k go for it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/exec area/execd Issues related to execd or plugins that would be better suited to be used through execd 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