# \[Solved\] Default refresh interval being ignored

**URL:** <https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318>\
**Category:** Elasticsearch\
**Created:** [February 16, 2017, 11:20am UTC](https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318 "2017-02-16T11:20:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thecosmicfrog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thecosmicfrog/32/15571_2.png) [@thecosmicfrog](https://discuss.elastic.co/u/thecosmicfrog)\
**Post date:** [February 16, 2017, 11:20am UTC](https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318/1 "2017-02-16T11:20:07Z")

</div>

Hi there,

I would like to increase the refresh interval for **all future indices** to **30s**.

To do this, I've set the following config (on all nodes) in elasticsearch.yml and restarted:

```
# Increase refresh interval.
 index.refresh_interval: 30s

```

However, it seems that whenever Logstash creates an index in Elasticsearch, it sets the refresh interval for that index to **5s** , as below:

```
$ curl http://ES_HOST:PORT/logstash-2017.02.16.11?pretty

[...]
"settings" : {
  "index" : {
    "creation_date" : "1487242800240",
    "refresh_interval" : "5s",
    "number_of_shards" : "5",
    "number_of_replicas" : "1",
    "uuid" : "abc123",
    "version" : {
      "created" : "2040499"
    }
  }
},
[...]

```

I'm not sure if this is an issue with my Elasticsearch configuration, or Logstash simply overriding the default set by the Elasticsearch nodes.

I'd appreciate any advice or help with this issue. Many thanks!

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [February 17, 2017, 9:36am UTC](https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318/2 "2017-02-17T09:36:33Z")

</div>

Hi @thecosmicfrog,

I guess you are on an older version of Elasticsearch like 1.x or 2.x as you've defined this setting in `elasticsearch.yml`. I recommend you define this setting with an index template instead:

```auto
PUT /_template/my_default_template
{
  "template": "*",
  "settings": {
    "refresh_interval": "30s"
  }
}

```

_Note: This will also simplify upgrading as Elasticsearch 5 does not allow you anymore to define index settings in `elasticsearch.yml`._

It's hard to tell why the refresh interval is `5s` though. The most likely cause is that you already have an index template that overrides your setting. Just issue `GET /_template` to see a list of all your index templates and see if you can find it that way.

Daniel

---

<div class="post-metadata">

**Author:** ![thecosmicfrog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thecosmicfrog/32/15571_2.png) [@thecosmicfrog](https://discuss.elastic.co/u/thecosmicfrog)\
**Post date:** [February 17, 2017, 1:22pm UTC](https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318/3 "2017-02-17T13:22:17Z")

</div>

Hi @danielmitterdorfer,

Yes, that's correct. I'm currently on version 2.4.4 - I should have included this in the OP - apologies!

Fantastic! That solved my issue completely. There was indeed a default template for Logstash which enforced a **refresh\_interval** of **5s**. I deleted it and created a new template per your suggestion above. The refresh interval is now correct at **30s**.

Thank you so much for your assistance!

All the best,  
Aaron

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [February 17, 2017, 1:28pm UTC](https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318/4 "2017-02-17T13:28:15Z")

</div>

Hi Aaron,

you're welcome. I am glad it works now! 🙂

Daniel

---

<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:** [March 17, 2017, 1:28pm UTC](https://discuss.elastic.co/t/solved-default-refresh-interval-being-ignored/75318/5 "2017-03-17T13:28:39Z")

</div>

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