Unable to use env variable with multiple hosts, for ES hosts output

Hi,
I'm running logstash in a k8s cluster using the logstash helm chart.

I have a .env file from which I create a k8s secret, which is used within logstash.

in my .env, I have my hosts defined like:
ES_NODES="elk1.host.cloud.com elk2.host.cloud.com elk3.host.cloud.com"

and in elastic ouput:
hosts => "${ES_NODES}"

This should be correct,
according to an older topic

Yet all I get is the error:

Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"Java::JavaLang::IllegalStateException", :message=>"Unable to configure plugins: Illegal character in scheme name at index 0: \"elk1.host.cloud.com"

Is this k8s specific problem?

Hello,

As per the post shared could you please try to use below :

ES_NODES="https://host-01:9200 https://host-02:9200 https://host-03:9200"

Thanks!!

I seem to have tried with this pattern as well, but got the same result.

For now I added a separate secret with separate hosts.

Hi,

for info, I had the same prob and solved it with help of this post:

in short its to do with quotes around the environment variable. In my case I was using docker compose to pass in the environment variable and it seems the initial " character was being passed right through and then being considered part of the URL. Take away the quotes around the list of servers in my docker compose file and it all works. Suspect similar behaviour happening in with other docker / k8s descriptors