title: Index policy or Index template for Elasticsearh
body: <p>I have elasticsearch cluster for storing logs, and i have indices like this</p>
  <pre><code>logs-2021.01.01
  logs-2021.01.02
  logs.2021.01.03 ...etc
  </code></pre>
  <p>so indices creates at daily basis, and i have index template for this indices</p>
  <pre><code>PUT _index_template/template_1
  {
    &quot;index_patterns&quot;: [&quot;logs*&quot;],
    &quot;template&quot;: {
      &quot;settings&quot;: {
        &quot;number_of_shards&quot;: 6,
        &quot;number_of_replicas&quot;: 1
      }
  </code></pre>
  <p>but I want to make sure that indexes that are older than 1 day have 0 replicas to save disk space, and indexes that are younger than 1 day remain with 1 replica (so that in case of server loss, I have data for today)</p>
  <p>how can i do this using elasticsearch way? i think about bash script that executes by cron , which get all of the indices which older than 1 day and make 0 replica, but i don't want to use external scripts to do that
  Thank you for you help</p>