bento icon indicating copy to clipboard operation
bento copied to clipboard

Set environment variables in Stream mode using query options

Open mbneimann opened this issue 9 months ago • 1 comments

When running Bento in Streams mode, there is no way of setting environment variables after the bento process have been started. This also prevents us from using environment variables for secrets.

I suggest using query options on requests to the Streams API for setting environment variables. All query options gets added as an environment variable and can be referenced in the stream configurations with the usual ${variable} syntax.

Example:

curl http://0.0.0.0:4195/streams/using_env_variables?PASSWORD=p3w0rd --data-binary @- <<EOF
input:
  label: ""
  generate:
    mapping: root = "password=\${PASSWORD}"
    count: 1

output:
  stdout:
    codec: lines
EOF

mbneimann avatar Mar 06 '25 11:03 mbneimann