-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Environment variables sometimes aren't working? #6696
Comments
+1 |
Hi, We have this issue too and we think it's a bug that appeared between logstash 5.1.1 and logstash 5.2.2 Using logstash 5.2.2
Using logstash 5.1.1 it works. conf :
ES_HOST="http://elasticsearch:9200" |
+1 |
+1 and I repeated this issue with logstash version 5.3.0 |
I can recreate this issue on 5.1 with the twitter plugin.
|
I wonder if it's only the output->elasticsearch->hosts param, for whatever reason. |
You may be correct @tedder. IME, it's confusing if the parser does not do a variable substitution before passing off the data structure to plugins. |
@ianks it does do variable substitution before passing to the plugins, which is why I am so confused how this even happens. Very strange bug. |
@suyograo I've marked this a blocker for 5.4.0. I'm hoping it's easy to fix. |
@ianks example to recreate the issue in 5.1, fixes things for me in 5.4
|
Logstash 5.4.0 was released without fixing this. Moved to 5.5 |
@jordansissel so just to clarify the correct behavior here: We are interpolating all environment variables in the config and require |
@original-brownbear We don't support escapes in configs today, but our intent is to interpret environment variables. We added this some versions ago and at some point is went weird and sometimes -- for some plugin settings -- is evaluating them correctly. |
@original-brownbear correct ^^ We only expand env variables if it has this syntax |
@jordansissel @suyograo thanks guys, let me try and fix it real quick then :) |
fixed in #7411 |
I'm not sure what causes this, but it's easy to reproduce. Reproduced only with Elasticsearch output but haven't tried other plugins.
for openers:
The specific part of the error for focus:
bad URI(is not URI?): ${ES_HOST}"}
I tested other settings (heartbeat_path) and env vars are working there.
The text was updated successfully, but these errors were encountered: