Skip to content

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

@micoq

Description

@micoq

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/execarea/execdIssues related to execd or plugins that would be better suited to be used through execdfeature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions