Changing the default shards number (primary and replicas) by the console

Hello,

I tried to add a template to reduce the defaut number of shards (for all future indexes) with the API :

PUT /_template/shardsnumber
{
    "template" : "logstash-",
    "order" : 1,
    "settings" : {
        "number_of_shards" : 4,
        "number_of_replicas": 0
    }
} 

Since I specified the order to 1 and the default template's one is set to 0, this should override the defaut number of 5 and works, shouldn't it ?

But when I send logs via logstash it still creates 10 shards (5 primary, 5 replicas). The index didn't exist before I create the template too.

Here's my logstash.conf output part :

output {
  if "squid3" in [tags] {
    elasticsearch {
      hosts => ["10.2.2.44:9200", "10.2.2.45:9200", "10.2.2.46:9200", "10.2.2.47:9200"]
      index => "logstash-squid3-%{+YYYY.MM}"
    }
  }
}

Any insights on what I'm doing wrong ?
Thanks!

I'm stupid, forgot the wildcard. Didn't find an option to delete the topic, please feel free to do so.

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