The value of dollar sign variable ${VAR} can be resolved from environment variable and keystore. When the same key is defined in both places, keystore takes the precedence.
However, when using logstash docker image and passing env variables with a naming convention that replace the config settings in logstash.yml from . to _, eg. log.level -> LOG_LEVEL, the startup process env2yaml overwrites logstash.yml with actual values from env regardless of existing settings in the file. In this scenario, env wins the precedence. Only the variables listed in env2yaml have inconsistent issue.
The order is confusing when configuring logstash in kubernetes especially when keystore, env and the default value ${VAR:default_value} can set the value. The ordering of resolving ${VAR} should be default_value < env < keystore where the latter takes the precedence.
The value of dollar sign variable
${VAR}can be resolved from environment variable and keystore. When the same key is defined in both places, keystore takes the precedence.However, when using logstash docker image and passing env variables with a naming convention that replace the config settings in
logstash.ymlfrom.to_, eg. log.level -> LOG_LEVEL, the startup process env2yaml overwriteslogstash.ymlwith actual values from env regardless of existing settings in the file. In this scenario, env wins the precedence. Only the variables listed in env2yaml have inconsistent issue.The order is confusing when configuring logstash in kubernetes especially when keystore, env and the default value ${VAR:default_value} can set the value. The ordering of resolving ${VAR} should be default_value < env < keystore where the latter takes the precedence.