Open robbavey opened 7 months ago
🧐 so we do two passes of substitutions, once on the decoded YAML (where the entire pipeline.string
value is just a string), and then again on the pipeline definition (where the variable, if it were left in expanded, would be a comment). In the first pass, we don't have enough context to know that the variable is in a comment.
The reversion in #16201 means this issue is still present
bin/logstash --version
) Latest versions of7.17
,8.12
andmain
JVM (e.g.
java -version
): Bundled JVMDescription of the problem including expected versus actual behavior: When running a pipeline defined in
pipelines.yml
, pipelines defined inconfig.string
that have commented out lines, will have any variable substitution (ENV or keystore) present in those commented out lines, evaluated.This was discovered during ECK testing when commenting out a plugin definition that contained a non-existent ENV variable normally provided by
ElasticsearchRef
Steps to reproduce:
Create a
pipelines.yml
that looks like:and run
bin/logstash
.Logstash will fail to start (regardless of whether there are also valid pipelines specified), giving the following error:
Note that this does not happen when pipelines are configured in config files, either directly via
-f
, or referred to inpipelines.yml