logstash
logstash copied to clipboard
Inconsistent order of resolving ${VAR} value
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. api.ssl.enabled -> API_SSL_ENABLED, the startup process env2yaml overwrites logstash.yml
with actual values from env regardless of existing setttings in the file. In this scenario, env wins the precedence.
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.