File tree Expand file tree Collapse file tree
logstash-core/lib/logstash/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,9 +74,13 @@ def replace_placeholders(value)
7474 raise LogStash ::ConfigurationError , "Cannot evaluate `#{ placeholder } `. Replacement variable `#{ name } ` is not defined in a Logstash secret store " +
7575 "or as an Environment entry and there is no default value given."
7676 end
77- # if array string, remove literal brackets and make array
78- replacements = replacement . gsub ( /[\[ \] ]/ , '' )
79- return replacements . split ( ', ' ) . map ( &:strip )
77+ # if ENV carries array string, remove literal brackets and make array
78+ if replacement . is_a? ( String ) && replacement . start_with? ( '[' ) && replacement . end_with? ( ']' )
79+ replacements = replacement . gsub ( /[\[ \] ]/ , '' )
80+ return replacements . split ( ', ' ) . map ( &:strip )
81+ else
82+ replacement . to_s
83+ end
8084 end
8185 end # def replace_placeholders
8286
You can’t perform that action at this time.
0 commit comments