title: Logstash keeps overwriting Elasticsearch index template
body: <p>I am sending log data to Elasticsearch database using Logstash. I wanted to change the number of shards from 3 to 1 and issued the following command via ES REST API:</p>
  
  <pre><code>PUT server_name/_template/logstash
  {
      "template": "logstash",
          "settings": {
              "index.number_of_replicas": "0",
              "index.refresh_interval": "5s",
              "index.number_of_shards": "1"
          }
  }
  </code></pre>
  
  <p>The server responsed OK and if I issue GET _template/logstash I can see that the number of shards is now set to 1.</p>
  
  <p>Then I start logstash with an output set to ship logs to Elasticsearch. There are not template-related settings. After I send log data I see that the number of shards is set back to its default value (3).</p>
  
  <p>I even tried to override it by referring template from Logstash configuration file. Nope, whatever I specify the settings are reset back. It looks like Logstash keeps on overwriting Elasticsearch index settings with some defaults, and I can't figure out how to disable this.</p>
  
  <p>UPDATE. I've added the following lines to the Logstash config file but it didn't help:</p>
  
  <pre><code>    manage_template =&gt; false
      template_overwrite =&gt; true
  </code></pre>
  
  <p>Also tried template_overwrite set to false. And I tried two different ways of setting number of shards in the JSON file:</p>
  
  <pre><code>{
      "logstash": {
          "template": "logstash-*",
          "settings": {
              "index.number_of_replicas": "0",
              "index.refresh_interval": "5s",
              "index.number_of_shards": "1"
          }
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>{
      "template": "logstash-*",
      "settings" : {
          "index.number_of_shards" : 1,
          "index.number_of_replicas" : 0,
      }
  }
  </code></pre>