# Possible to set default refresh\_interval for all new indices?

**URL:** <https://discuss.elastic.co/t/possible-to-set-default-refresh-interval-for-all-new-indices/57993>\
**Category:** Elasticsearch\
**Created:** [August 15, 2016, 12:52am UTC](https://discuss.elastic.co/t/possible-to-set-default-refresh-interval-for-all-new-indices/57993 "2016-08-15T00:52:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstultz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jstultz/32/11370_2.png) [@jstultz](https://discuss.elastic.co/u/jstultz)\
**Post date:** [August 15, 2016, 12:52am UTC](https://discuss.elastic.co/t/possible-to-set-default-refresh-interval-for-all-new-indices/57993/1 "2016-08-15T00:52:16Z")

</div>

After running into some scaiing problems with our Elasticsearch cluster (running as part of an ELK stack), I read up on refreshes, and in particular, the refresh interval. I set it from 1s to 30s (which should be totally acceptable for our needs), and performance improved dramatically, which was wonderful.

That is, until the day ended and a new set of indices were created, which had the default value of 1s again.

The command I originally issued to set the interval to 30s for all indices:

```auto
curl -XPUT hostname:9200/_settings -d '{
  "index": {
    "refresh_interval": "30s"
  }
}'

```

Is there some different command to have it take effect on a cluster-wide basis? Is this something I can do with index templates? If so, is that the only way to do so?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 15, 2016, 1:40am UTC](https://discuss.elastic.co/t/possible-to-set-default-refresh-interval-for-all-new-indices/57993/2 "2016-08-15T01:40:28Z")

</div>

You do that in templates - [https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html#indices-templates](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html#indices-templates)

---

<div class="post-metadata">

**Author:** ![jstultz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jstultz/32/11370_2.png) [@jstultz](https://discuss.elastic.co/u/jstultz)\
**Post date:** [August 15, 2016, 2:10am UTC](https://discuss.elastic.co/t/possible-to-set-default-refresh-interval-for-all-new-indices/57993/3 "2016-08-15T02:10:26Z")

</div>

Excellent, thank you very much.

For future reference to others viewing, this worked for me:

```auto
curl -XPUT hostname:9200:/_template/all_indices -d '
{
  "template": "*",
  "settings": {
    "refresh_interval": "30s"
  }
}
`

```

---

<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 5, 2017, 10:27pm UTC](https://discuss.elastic.co/t/possible-to-set-default-refresh-interval-for-all-new-indices/57993/4 "2017-07-05T22:27:51Z")

</div>


