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

[backport] 2.x Add Environment Variable Support Flag (--allow-env) #5003

Closed
wants to merge 1 commit into from

Conversation

talevy
Copy link
Contributor

@talevy talevy commented Apr 4, 2016

backport of: #4963

for merging into 2.x and 2.3 branches

@ph
Copy link
Contributor

ph commented Apr 4, 2016

LGTM,

~/e/logstash git:pr/5003 ❯❯❯ bin/logstash -e 'input { generator  { message => "PH is ${QUALITY}" count => 1 }} filter { mutate {}}'                                                                                                                                                                                       ✱
Settings: Default pipeline workers: 4
Pipeline main started
{
      "sequence" => 0,
    "@timestamp" => 2016-04-04T20:20:38.232Z,
      "@version" => "1",
          "host" => "sashimi",
       "message" => "PH is ${QUALITY}"
}
Pipeline main has been shutdown
^CSIGINT received. Shutting down the agent. {:level=>:warn}
stopping pipeline {:id=>"main"}
~/e/logstash git:pr/5003 ❯❯❯ bin/logstash -e 'input { generator  { message => "PH is ${QUALITY}" count => 1 }} filter { mutate {}}' --allow-env                                                                                                                                                                           ✱
fetched an invalid config {:config=>"input { generator  { message => \"PH is ${QUALITY}\" count => 1 }} filter { mutate {}}output { stdout { codec => rubydebug } }", :reason=>"Cannot evaluate `${QUALITY}`. Environment variable `QUALITY` is not set and there is no default value given.", :level=>:error}
~/e/logstash git:pr/5003 ❯❯❯ export QUALITY="awesome"                                                                                                                                                                                                                                                                   ⏎ ✱
~/e/logstash git:pr/5003 ❯❯❯ bin/logstash -e 'input { generator  { message => "PH is ${QUALITY}" count => 1 }} filter { mutate {}}' --allow-env                                                                                                                                                                           ✱
Settings: Default pipeline workers: 4
Pipeline main started
{
      "sequence" => 0,
    "@timestamp" => 2016-04-04T20:21:01.036Z,
      "@version" => "1",
          "host" => "sashimi",
       "message" => "PH is awesome"
}
Pipeline main has been shutdown
^CSIGINT received. Shutting down the agent. {:level=>:warn}
stopping pipeline {:id=>"main"}

@andrewvc
Copy link
Contributor

andrewvc commented Apr 4, 2016

@talevy something is wrong with the I18N lookup, but it's otherwise good

    --allow-env                   translation missing: en.logstash.runner.flag.allow_env (default: false)

@ph
Copy link
Contributor

ph commented Apr 4, 2016

@andrewvc good catch I haven't checked that :( oops.

@andrewvc
Copy link
Contributor

andrewvc commented Apr 4, 2016

LGTM

@elasticsearch-bot
Copy link

Tal Levy merged this into the following branches!

Branch Commits
2.3 d158fe7
2.x 7d86a61

@talevy
Copy link
Contributor Author

talevy commented Apr 4, 2016

Jarvis merged into 2.x and 2.3. closing.

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

Successfully merging this pull request may close these issues.

4 participants