# ILM Logstash and Elastic (again)

**URL:** <https://discuss.elastic.co/t/ilm-logstash-and-elastic-again/253541>\
**Category:** Logstash\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 28, 2020, 10:06am UTC](https://discuss.elastic.co/t/ilm-logstash-and-elastic-again/253541 "2020-10-28T10:06:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)\
**Post date:** [October 28, 2020, 10:06am UTC](https://discuss.elastic.co/t/ilm-logstash-and-elastic-again/253541/1 "2020-10-28T10:06:10Z")

</div>

Hi,

I have following configurations:

logstash output:

```
output {
  elasticsearch {
    hosts => ["elastic.server.com"]
	ilm_rollover_alias => "filebeat-vm-linux"
    ilm_pattern => "{now/d}-000001"
	ilm_policy => "test_policy"
	ilm_enabled => true
	ssl => true
	ssl_certificate_verification => true
	cacert => 'ca.crt'
    user => logstash   
    password => "${LOGSTASH}"
  }

```

test\_policy:

```
PUT _ilm/policy/test_policy
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "1m",
            "max_size": "50gb"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "1m",
        "actions": {
          "delete": {}
        }
      }
    }
  }
}

```

index template:

```
PUT _template/linux_vm_template
{
  "order": 0,
  "index_patterns": [
    "filebeat-vm-linux*"
  ],
  "settings": {
    "index": {
      "lifecycle": {
        "name": "test_policy",
        "rollover_alias": "filebeat-vm-linux"
      },
      "number_of_shards": "3",
      "number_of_replicas": "1"
    }
  },
  "mappings": {
    "_doc": {
      "_meta": {},
      "_source": {},
      "properties": {}
    }
  }
}

```

Expected result:

First index:  
filebeat-vm-linux-{now/d}-000001

every minute (just for testing) new index is getting created as defined in the policy:

```
filebeat-vm-linux-{now/d}-000002
filebeat-vm-linux-{now/d}-000003
filebeat-vm-linux-{now/d}-000004
filebeat-vm-linux-{now/d}-000005 

```

and so on.

Observated result:

`filebeat-vm-linux` was created and is constantly growing without any rollover actions.

In addition to that I have an error appearing in the index management in kibana:

`illegal_argument_exception: index.lifecycle.rollover_alias [filebeat-vm-linux] does not point to index [filebeat-vm-linux]`

Can anyone help me to understand why it does happen?

Thanks

---

<div class="post-metadata">

**Author:** ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)\
**Post date:** [October 28, 2020, 10:47am UTC](https://discuss.elastic.co/t/ilm-logstash-and-elastic-again/253541/2 "2020-10-28T10:47:39Z")

</div>

I have modified the logstash output and added the template configuration as follows:

```
output {
  elasticsearch {
    hosts => ["elastic.server.com"]
    template_name => "linux_vm_template"
    template_overwrite => true
	ilm_rollover_alias => "filebeat-vm-linux"
    ilm_pattern => "{now/d}-000001"
	ilm_policy => "test_policy"
	ilm_enabled => true
	ssl => true
	ssl_certificate_verification => true
	cacert => 'ca.crt'
    user => logstash   
    password => "${LOGSTASH}"
  }

```

after that **I have removed the lifecycle part from the index template** (since the logstash output now will take care of updating the template with the right information as far as I understood).

Now the index `filebeat-vm-linux-{now/d}-000001` is created correctly and I have no errors anymore, but still the index is not getting rolled over as stated in the policy. Now I have a growing `filebeat-vm-linux-{now/d}-000001` index

---

<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:** [November 25, 2020, 10:47am UTC](https://discuss.elastic.co/t/ilm-logstash-and-elastic-again/253541/3 "2020-11-25T10:47:42Z")

</div>

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