-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Using environment variable for square brackets is not documented, not obvious #6352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @matthughes Sorry it has taken a while to look at this. The config file is just YAML, and arrays are perfectly acceptable in YAML, so I don't think it is worth preventing arrays from working. I agree though that the documentation could be improved, specifically here: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html#styles |
The relevant topic is now at: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html |
Pinging @elastic/es-core-infra |
Hey, I want to pick this up as my first OS contribution. Can someone help me? |
[docs issue triage] |
Looking at the Configuring Elasticsearch page for 7.6, there are no brackets included in examples. The only inclusions of brackets in a supported version are in the 6.8 version, which shows:
@debadair, is that a worthwhile change? Otherwise, it seems this issue is no longer relevant. |
Talked to @jrodewig about this one, and he thinks that there's value in documenting how arrays work for environment variables. |
I did some limited testing with the following variables in
If I include brackets around the variables
I then started Elasticsearch, which started normally. My takeaway is that brackets are not required when passing multiple variables in @rjernst, can you please review my findings and let me know if I'm on the right track? I'm still learning who does what, but I think that this is your area of expertise. |
The example config in elasticsearch.yml is:
#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]
Using environment variables, I would assume to replace everything in square brackets:
export ES_HOSTS="[host1, host2:port]" discovery.zen.ping.unicast.hosts: $ES_HOSTS
This does not parse correctly though. The only way I could get it to work was omit the brackets:
export ES_HOSTS="host1, host2:port" discovery.zen.ping.unicast.hosts: $ES_HOSTS
Given that this is not documented, not obvious, and also parses fine as:
#discovery.zen.ping.unicast.hosts: "host1", "host2:port"
I propose we change the default config file. There is also no other use of square brackets in the config file.
The text was updated successfully, but these errors were encountered: