How to update refresh interval for all existing indices

Hi,

I want to update the refresh interval for all my existing indices(approx 200-300 indices) to 60s.
Though I know we can achieve it using template, but per my understanding that template will be effective only for new indices.
Is there any possible way to update refresh interval for all existing indices. Either on cluster basis or some other way of doing that.

You can specify _all which will then affect all your indices. For instance, this will set the refresh interval to 20 seconds in all the indices:

curl -XPUT "http://localhost:9200/_all/_settings?pretty" -H "Content-Type: application/json" -d '{
      "index" : {
           "refresh_interval" : "20s"
      }
}'

That's work fine. Thanks for contributing. :+1:

1 Like

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