# Problem with elasticsearch ILM

**URL:** <https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [January 26, 2021, 5:41pm UTC](https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265 "2021-01-26T17:41:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [January 26, 2021, 5:41pm UTC](https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265/1 "2021-01-26T17:41:50Z")

</div>

I have an index log-wlb-sysmon-2021.01.26 having 3 shards and zero replica its size is 30 mb.  
Here is my sysmon index template

```auto
 "refresh_interval": "5s",
    "number_of_shards": "3",
    "number_of_replicas": "0"

```

Now i want to use ilm policy for an existing index  
so i created a **ilm** policy called _sysmon\_policy_

```auto
PUT _ilm/policy/sysmon_policy
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_size": "100mb",
            "max_age": "1d"
          },
          "set_priority": {
            "priority": 100
          }
        }
      }
    }
  }
}

```

then i add ilm policy to existing sysmon index\_template

```auto
 "lifecycle": {
      "name": "sysmon_policy",
      "rollover_alias": "log-wlb-sysmon"
    }

```

In logstash pipeline file i made few changes

```auto
output {
  if [@metadata][index_name] == "sysmon"
{
elasticsearch {
 hosts => ["http://elastic:9200"]
 ilm_rollover_alias => "log-wlb-sysmon"
 ilm_pattern => "000001"
 ilm_policy => "sysmon_policy"
}
}

```

then i restart the logstash and i see an index log-wlb-sysmon-000001 having 1 shards and zero replica  
The question is why it dont have 3 shards and zero replica existing index have 3 shards and zero replica.  
I am using elk stack 7.10.2

---

<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:** [January 26, 2021, 9:23pm UTC](https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265/2 "2021-01-26T21:23:41Z")

</div>

Can you post the entire index template you used please?

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [January 27, 2021, 6:25am UTC](https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265/3 "2021-01-27T06:25:37Z")

</div>

Hey @warkolm i created this template from kibana(stack management -\>Inddex template-\>create legacy template)  
This template i am seeing from kibana

```auto
{
  "index": {
    "lifecycle": {
      "name": "sysmon_policy",
      "rollover_alias": "log-wlb-sysmon"
    },
    "refresh_interval": "5s",
    "number_of_shards": "3",
    "number_of_replicas": "0"
  }
}

```

GET /\_cat/templates/sysmon?v&pretty

```auto
name index_patterns order version composed_of
sysmon [log-wlb-sysmon-*] 0        

```

---

<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:** [January 27, 2021, 7:35am UTC](https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265/4 "2021-01-27T07:35:22Z")

</div>

> [@Aniket\_Pant](#):
>
> ```auto
> ilm_rollover_alias => "log-wlb-sysmon"
> 
> ```

That doesn't match;

> [@Aniket\_Pant](#):
>
> ```auto
> "rollover_alias": "log-wlb-sysmon"
> 
> ```

From what I can see.

---

<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:** [February 24, 2021, 7:35am UTC](https://discuss.elastic.co/t/problem-with-elasticsearch-ilm/262265/5 "2021-02-24T07:35:23Z")

</div>

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