# 0.90.1 spaces in elasticsearch.yml, lines get ignored

**URL:** <https://discuss.elastic.co/t/0-90-1-spaces-in-elasticsearch-yml-lines-get-ignored/12698>\
**Category:** Elasticsearch\
**Created:** [July 8, 2013, 11:20am UTC](https://discuss.elastic.co/t/0-90-1-spaces-in-elasticsearch-yml-lines-get-ignored/12698 "2013-07-08T11:20:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)\
**Post date:** [July 8, 2013, 11:20am UTC](https://discuss.elastic.co/t/0-90-1-spaces-in-elasticsearch-yml-lines-get-ignored/12698/1 "2013-07-08T11:20:00Z")

</div>

I just had a weird thing, might be a bug or a feature, I'm not sure.

My elasticsearch.yml was like this:  
cluster.name: blah  
transport.tcp.port: 9308  
http.port: 9208

The leading space on the line with cluster.name caused the transport.tcp  
and http.port to be ignored. I guess it has to do with yml nesting.  
In the logs nothing showed up about the ignored lines, I don't know exactly  
how this works, but I feel this should be at least a warning.

Of course we removed the leading space which made it work again.

Jaap

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [July 8, 2013, 12:50pm UTC](https://discuss.elastic.co/t/0-90-1-spaces-in-elasticsearch-yml-lines-get-ignored/12698/2 "2013-07-08T12:50:00Z")

</div>

Hi Jaap,

You got it right, it's because of the role of indentation in YAML, which is  
similar to the way you'd indent code in Python (an indented property  
"belongs" to the previous one). You can play with an online parser like  
this one:  
[http://yaml-online-parser.appspot.com/](http://yaml-online-parser.appspot.com/)

And see how it would output your config in JSON.

Best regards,  
Radu

On Mon, Jul 8, 2013 at 2:20 PM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:

> I just had a weird thing, might be a bug or a feature, I'm not sure.
> 
> My elasticsearch.yml was like this:  
> cluster.name: blah  
> transport.tcp.port: 9308  
> http.port: 9208
> 
> The leading space on the line with cluster.name caused the transport.tcp  
> and http.port to be ignored. I guess it has to do with yml nesting.  
> In the logs nothing showed up about the ignored lines, I don't know  
> exactly how this works, but I feel this should be at least a warning.
> 
> Of course we removed the leading space which made it work again.
> 
> Jaap
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)\
**Post date:** [July 8, 2013, 5:00pm UTC](https://discuss.elastic.co/t/0-90-1-spaces-in-elasticsearch-yml-lines-get-ignored/12698/3 "2013-07-08T17:00:34Z")

</div>

Hi Radu,

Just like I said, I already figured that out, the point was that this could  
be a mistake more people may make. Because the file already has a space  
after every hash, deleting only the hash and not the space leads to this  
unexpected result.

Suggestion:  
All describing comments should have the space, all examples just waiting to  
be uncommented =\> no spacing after the hash.

Jaap  
On Jul 8, 2013 2:50 PM, "Radu Gheorghe" [radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com) wrote:

> Hi Jaap,
> 
> You got it right, it's because of the role of indentation in YAML, which  
> is similar to the way you'd indent code in Python (an indented property  
> "belongs" to the previous one). You can play with an online parser like  
> this one:  
> [http://yaml-online-parser.appspot.com/](http://yaml-online-parser.appspot.com/)
> 
> And see how it would output your config in JSON.
> 
> Best regards,  
> Radu
> 
> On Mon, Jul 8, 2013 at 2:20 PM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> 
> > I just had a weird thing, might be a bug or a feature, I'm not sure.
> > 
> > My elasticsearch.yml was like this:  
> > cluster.name: blah  
> > transport.tcp.port: 9308  
> > http.port: 9208
> > 
> > The leading space on the line with cluster.name caused the transport.tcp  
> > and http.port to be ignored. I guess it has to do with yml nesting.  
> > In the logs nothing showed up about the ignored lines, I don't know  
> > exactly how this works, but I feel this should be at least a warning.
> > 
> > Of course we removed the leading space which made it work again.
> > 
> > Jaap
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/6DGDSXHE1nU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/6DGDSXHE1nU/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:27am UTC](https://discuss.elastic.co/t/0-90-1-spaces-in-elasticsearch-yml-lines-get-ignored/12698/4 "2017-07-06T02:27:34Z")

</div>


