# Optional parameters in elasticsearch.yml

**URL:** <https://discuss.elastic.co/t/optional-parameters-in-elasticsearch-yml/20295>\
**Category:** Elasticsearch\
**Created:** [October 16, 2014, 7:50pm UTC](https://discuss.elastic.co/t/optional-parameters-in-elasticsearch-yml/20295 "2014-10-16T19:50:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhughes](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mhughes](https://discuss.elastic.co/u/mhughes)\
**Post date:** [October 16, 2014, 7:50pm UTC](https://discuss.elastic.co/t/optional-parameters-in-elasticsearch-yml/20295/1 "2014-10-16T19:50:17Z")

</div>

I have parameterized my elasticsearch.yml file like so:

node.name: ${NODE\_NAME}

This let's me pass in NODE\_NAME as an environment variable when running  
ES. I was _hoping_ that if NODE\_NAME was undefined, ES would fall back to  
the default of picking a dynamic name, but it just dies. Is there any way  
to specify an _optional_ syntax for env variables?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 16, 2014, 10:48pm UTC](https://discuss.elastic.co/t/optional-parameters-in-elasticsearch-yml/20295/2 "2014-10-16T22:48:08Z")

</div>

You could try using an if statement in your env variable?

On 17 October 2014 06:50, Matt Hughes [hughes.matt@gmail.com](mailto:hughes.matt@gmail.com) wrote:

> I have parameterized my elasticsearch.yml file like so:
> 
> node.name: ${NODE\_NAME}
> 
> This let's me pass in NODE\_NAME as an environment variable when running  
> ES. I was _hoping_ that if NODE\_NAME was undefined, ES would fall back to  
> the default of picking a dynamic name, but it just dies. Is there any way  
> to specify an _optional_ syntax for env variables?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAF3ZnZmMBRVTnirSWB%3D9XqCnRfBLaRTOEMxiBt-M%2B6Uiqo2ADQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAF3ZnZmMBRVTnirSWB%3D9XqCnRfBLaRTOEMxiBt-M%2B6Uiqo2ADQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![mhughes](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mhughes](https://discuss.elastic.co/u/mhughes)\
**Post date:** [October 23, 2014, 7:18pm UTC](https://discuss.elastic.co/t/optional-parameters-in-elasticsearch-yml/20295/3 "2014-10-23T19:18:51Z")

</div>

Unclear how that would work. Example?

On Thursday, October 16, 2014 6:49:13 PM UTC-4, Mark Walkom wrote:

> You could try using an if statement in your env variable?
> 
> On 17 October 2014 06:50, Matt Hughes \<[hughe...@gmail.com](mailto:hughe...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > I have parameterized my elasticsearch.yml file like so:
> > 
> > node.name: ${NODE\_NAME}
> > 
> > This let's me pass in NODE\_NAME as an environment variable when running  
> > ES. I was _hoping_ that if NODE\_NAME was undefined, ES would fall back to  
> > the default of picking a dynamic name, but it just dies. Is there any way  
> > to specify an _optional_ syntax for env variables?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e2c1ae6c-0e30-423b-9e11-82a3b2d83bd2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ceaa6957-c26d-4dc6-99f8-6a997aef1d94%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ceaa6957-c26d-4dc6-99f8-6a997aef1d94%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:54am UTC](https://discuss.elastic.co/t/optional-parameters-in-elasticsearch-yml/20295/4 "2017-07-06T00:54:06Z")

</div>


