{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/logstash/issues/4963","repository_url":"https://api.github.com/repos/elastic/logstash","labels_url":"https://api.github.com/repos/elastic/logstash/issues/4963/labels{/name}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/4963/comments","events_url":"https://api.github.com/repos/elastic/logstash/issues/4963/events","html_url":"https://github.com/elastic/logstash/pull/4963","id":145041390,"number":4963,"title":"add experimental flag for environment variables in config","user":{"login":"talevy","id":388837,"avatar_url":"https://avatars.githubusercontent.com/u/388837?v=3","gravatar_id":"","url":"https://api.github.com/users/talevy","html_url":"https://github.com/talevy","followers_url":"https://api.github.com/users/talevy/followers","following_url":"https://api.github.com/users/talevy/following{/other_user}","gists_url":"https://api.github.com/users/talevy/gists{/gist_id}","starred_url":"https://api.github.com/users/talevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talevy/subscriptions","organizations_url":"https://api.github.com/users/talevy/orgs","repos_url":"https://api.github.com/users/talevy/repos","events_url":"https://api.github.com/users/talevy/events{/privacy}","received_events_url":"https://api.github.com/users/talevy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/logstash/labels/breaking-compatibility","name":"breaking-compatibility","color":"eb6420"},{"url":"https://api.github.com/repos/elastic/logstash/labels/discuss","name":"discuss","color":"cc317c"},{"url":"https://api.github.com/repos/elastic/logstash/labels/v2.3.1","name":"v2.3.1","color":"ededed"},{"url":"https://api.github.com/repos/elastic/logstash/labels/work%20in%20progress","name":"work in progress","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-31T23:07:08Z","updated_at":"2016-04-01T01:08:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elastic/logstash/pulls/4963","html_url":"https://github.com/elastic/logstash/pull/4963","diff_url":"https://github.com/elastic/logstash/pull/4963.diff","patch_url":"https://github.com/elastic/logstash/pull/4963.patch"},"body":"closes: https://github.com/elastic/logstash/issues/4958\r\n\r\nthe proposed solution is to re-introduce environment variable interpolation within configs to be hidden behind an experimental command line flag.\r\n\r\nAlong with this, there is one functional change:\r\n1. you can no longer reference environment variables using `$VAR` syntax, and must use the curly braces: `${VAR}`\r\n\r\nIn the future, we may want to introduce the ability to escape use `\\\\` so that strings with `${...}` can be interpreted as literals.\r\n\r\nthings missing:\r\n\r\n- [ ] end-to-end flag testing"},"comment":{"url":"https://api.github.com/repos/elastic/logstash/issues/comments/204196536","html_url":"https://github.com/elastic/logstash/pull/4963#issuecomment-204196536","issue_url":"https://api.github.com/repos/elastic/logstash/issues/4963","id":204196536,"user":{"login":"talevy","id":388837,"avatar_url":"https://avatars.githubusercontent.com/u/388837?v=3","gravatar_id":"","url":"https://api.github.com/users/talevy","html_url":"https://github.com/talevy","followers_url":"https://api.github.com/users/talevy/followers","following_url":"https://api.github.com/users/talevy/following{/other_user}","gists_url":"https://api.github.com/users/talevy/gists{/gist_id}","starred_url":"https://api.github.com/users/talevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talevy/subscriptions","organizations_url":"https://api.github.com/users/talevy/orgs","repos_url":"https://api.github.com/users/talevy/repos","events_url":"https://api.github.com/users/talevy/events{/privacy}","received_events_url":"https://api.github.com/users/talevy/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T01:08:39Z","updated_at":"2016-04-01T01:08:39Z","body":"Example Usage\r\n\r\n```bash\r\n$ rake artifact:tar\r\n$ tar -xzf build/logstash-5.0.0.dev.tar.gz\r\n...\r\n```\r\n\r\nWith `--allow-env` flag\r\n```\r\n$ FOO=foo bin/logstash -e 'input { generator { message => \"${FOO}\" count => 1 } }' --allow-env\r\n{:pipeline_id=>\"main\", :config_string=>\"input { generator { message => \\\"${FOO}\\\" count => 1 } }\", :config_path=>nil, :allow_env=>true}\r\nSettings: Default pipeline workers: 8\r\nPipeline main started\r\n{\r\n      \"sequence\" => 0,\r\n    \"@timestamp\" => 2016-04-01T01:05:57.634Z,\r\n      \"@version\" => \"1\",\r\n          \"host\" => \"elasticbox-2.local\",\r\n>>>>>       \"message\" => \"foo\"\r\n}\r\nPipeline main has been shutdown\r\nstopping pipeline {:id=>\"main\", :level=>:warn}\r\n```\r\n\r\nWithout `--allow-env` flag\r\n```\r\n$ FOO=foo bin/logstash -e 'input { generator { message => \"${FOO}\" count => 1 } }'\r\n{:pipeline_id=>\"main\", :config_string=>\"input { generator { message => \\\"${FOO}\\\" count => 1 } }\", :config_path=>nil, :allow_env=>false}\r\nSettings: Default pipeline workers: 8\r\nPipeline main started\r\n{\r\n      \"sequence\" => 0,\r\n    \"@timestamp\" => 2016-04-01T01:07:16.409Z,\r\n      \"@version\" => \"1\",\r\n          \"host\" => \"elasticbox-2.local\",\r\n>>>>>       \"message\" => \"${FOO}\"\r\n}\r\nPipeline main has been shutdown\r\n\r\n```"}}