# Index template comment doesn't work

**URL:** <https://discuss.elastic.co/t/index-template-comment-doesnt-work/170788>\
**Category:** Logstash\
**Created:** [March 4, 2019, 8:14pm UTC](https://discuss.elastic.co/t/index-template-comment-doesnt-work/170788 "2019-03-04T20:14:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kesha](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kesha](https://discuss.elastic.co/u/kesha)\
**Post date:** [March 4, 2019, 8:14pm UTC](https://discuss.elastic.co/t/index-template-comment-doesnt-work/170788/1 "2019-03-04T20:14:10Z")

</div>

Logstash: 6.5.4

Index template:

```
{
  "_rev": "$Rev: 902 $",
  "_comment": "Copyright © 2018, CCG, All rights reserved. ",

  "order": 0,
  "index_patterns": ["ossec-alerts-*"],
    "settings": {
     "index" : {
            "number_of_shards" : 3,
            "number_of_replicas" : 2
     },
     "refresh_interval": "5s",
     "index.mapping.ignore_malformed" : true,
     "index.codec" : "best_compression"
  },
  "mappings": {

```

If I keep the first two line comments inside the template, logstash will report 400 error can not get access to elasticsearch.

```
[ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"Got response code '400' contacting Elasticsearch at URL 'http://127.0.0.1:9200/_template/elastiflow'", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError", 

```

According to the official document, it claims that we can use /\*\*/ to comment info in template

```
Index templates provide C-style /* */ block comments. Comments are allowed everywhere in the JSON document except before the initial opening curly bracket.

```

So I added the /\* \*/ pair to the first two lines, but there's still the error, it can not parse the template.  
How can I add comments in the index template?

---

<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:** [April 1, 2019, 8:14pm UTC](https://discuss.elastic.co/t/index-template-comment-doesnt-work/170788/2 "2019-04-01T20:14:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
