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

**URL:** https://discuss.elastic.co/t/changing-the-default-shards-number-primary-and-replicas-by-the-console/66968
**Category:** Elasticsearch
**Created:** [November 23, 2016, 11:21am UTC](https://discuss.elastic.co/t/changing-the-default-shards-number-primary-and-replicas-by-the-console/66968 "2016-11-23T11:21:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Houss](https://avatars.discourse-cdn.com/v4/letter/h/a88e4f/32.png) [@Houss](https://discuss.elastic.co/u/Houss)
#### Post date: [November 23, 2016, 11:21am UTC](https://discuss.elastic.co/t/changing-the-default-shards-number-primary-and-replicas-by-the-console/66968/1 "2016-11-23T11:21:37Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Houss](https://avatars.discourse-cdn.com/v4/letter/h/a88e4f/32.png) [@Houss](https://discuss.elastic.co/u/Houss)
#### Post date: [November 23, 2016, 11:29am UTC](https://discuss.elastic.co/t/changing-the-default-shards-number-primary-and-replicas-by-the-console/66968/2 "2016-11-23T11:29:16Z")

</div>

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

---

<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: [December 21, 2016, 11:29am UTC](https://discuss.elastic.co/t/changing-the-default-shards-number-primary-and-replicas-by-the-console/66968/3 "2016-12-21T11:29:42Z")

</div>

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