# Using ILM with NetFlow module

**URL:** <https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969>\
**Category:** Logstash\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 26, 2019, 4:09pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969 "2019-03-26T16:09:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryne\_Keel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryne_keel/32/42827_2.png) [@Ryne\_Keel](https://discuss.elastic.co/u/Ryne_Keel)\
**Post date:** [March 26, 2019, 4:09pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/1 "2019-03-26T16:09:22Z")

</div>

This is hard to explain, but index life cycle policies do not work with at least the logstash netflow module.

The module, or elasticsearch create a new index each day. They use the index template to do so. To get it to not error that:

```
illegal_argument_exception: index.lifecycle.rollover_alias [netflow-alias] does not point to index [netflow-2019.03.26-1]

```

You have to put an alias in the index template.

If you put the alias in the index template, then when it tries to rollover you get an error about duplicate alias in the template.

```
illegal_argument_exception: Rollover alias [netflow-alias] can point to multiple indices, found duplicated alias [[netflow-alias]] in index template [netflow]

```

If you go in at this point and remove the alias from the template (not the rollover alias, but the regular alias) and use index management to retry the lifecycle step, it will start creating rollover indexes, named as expected, however, nothing gets written to them and the system keeps writing into the index that was created by the module / index template at the beginning of the day.

Then, the next day when it creates the new index, you get the following error again because you removed the alias from the index template to even get to this point..

```
illegal_argument_exception: index.lifecycle.rollover_alias [netflow-alias] does not point to index [netflow-2019.03.26-1]

```

Problems persists in 6.7.0

---

<div class="post-metadata">

**Author:** ![Ryne\_Keel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryne_keel/32/42827_2.png) [@Ryne\_Keel](https://discuss.elastic.co/u/Ryne_Keel)\
**Post date:** [March 26, 2019, 6:46pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/2 "2019-03-26T18:46:09Z")

</div>

If anyone knows what I am doing wrong or if this is a bug, please help me understand how this is supposed to work.

---

<div class="post-metadata">

**Author:** ![gbrown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gbrown/32/34482_2.png) [@gbrown](https://discuss.elastic.co/u/gbrown)\
**Post date:** [March 27, 2019, 7:29pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/3 "2019-03-27T19:29:33Z")

</div>

I suspect this is an issue with the NetFlow module - in order for ILM to work correctly, Logstash will need to write to the `netflow-alias` alias, but from what you're describing it sounds like it's writing directly to concrete daily indices.

For a normal pipeline, I would direct you to the [ILM section of the Elasticsearch output plugin configuration](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-ilm), but I don't see a way to change the index that the NetFlow module writes to. In the hopes of getting someone with more Logstash expertise looking at this, I'm going to move this topic to #logstash.

Regarding putting the alias in the template, we recommend that you don't do that - if data is correctly being written to the alias, rather than the underlying concrete index, what you should do is set up the index template, then create the first index with the alias by hand [as described in the ILM Getting Started documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/_applying_a_policy_to_our_index.html). If the index has already been created, it is also possible to add the alias using the [Index Aliases API](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-aliases.html).

---

<div class="post-metadata">

**Author:** ![gbrown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gbrown/32/34482_2.png) [@gbrown](https://discuss.elastic.co/u/gbrown)\
**Post date:** [March 27, 2019, 7:31pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/4 "2019-03-27T19:31:27Z")

</div>

I've moved this to #logstash from #elasticsearch and changed the title from "Elasticsearch: Index Rollover and Lifecycle Policy Issues" to "Using ILM with NetFlow module" as I believe that is more descriptive of the problem and more likely to get attention on the issue.

---

<div class="post-metadata">

**Author:** ![jakelandis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakelandis/32/36163_2.png) [@jakelandis](https://discuss.elastic.co/u/jakelandis)\
**Post date:** [March 27, 2019, 7:53pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/5 "2019-03-27T19:53:26Z")

</div>

@Ryne_Keel thanks for raising this issue.

Logstash modules are not currently supported with ILM. I logged [https://github.com/elastic/logstash/issues/10598](https://github.com/elastic/logstash/issues/10598) to track this issue.

---

<div class="post-metadata">

**Author:** ![Ryne\_Keel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryne_keel/32/42827_2.png) [@Ryne\_Keel](https://discuss.elastic.co/u/Ryne_Keel)\
**Post date:** [March 27, 2019, 8:59pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/6 "2019-03-27T20:59:34Z")

</div>

I will see if creating the index by hand makes a difference but need to look over the documentation and try it out before I will know if that helps. It would be awesome if it was an opt-in or opt-default as mentioned in your github issue, especially for netflow data. We aren't a huge ISP or anything, but have multiple transit providers and quite a few customers that use bandwidth, and we even generate 200+GB of netflow data per day.

Thanks guys!

---

<div class="post-metadata">

**Author:** ![Ryne\_Keel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryne_keel/32/42827_2.png) [@Ryne\_Keel](https://discuss.elastic.co/u/Ryne_Keel)\
**Post date:** [March 29, 2019, 3:53pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/7 "2019-03-29T15:53:25Z")

</div>

When I create the index manually / by hand it will write into the index I created, but when it rolls over I don't get anything to write into the rollover index and it keeps writing to the original one that I created.

What is odd is that I ran the following to manually make the index:

```
PUT netflow-2019.03.29-1
{
  "aliases": {
    "netflow-alias": {
      "is_write_index": true
    }
  }
}

```

Which creates netflow-2019.03.29-1 and shows

```
"lifecycle": {
        "name": "netflow_policy",
        "rollover_alias": "netflow-alias",
        "indexing_complete": "true"
      }

{
  "index.blocks.read_only_allow_delete": "false",
  "index.priority": "1",
  "index.query.default_field": [
    "*"
  ],
  "index.refresh_interval": "1s",
  "index.write.wait_for_active_shards": "1",
  "index.lifecycle.name": "netflow_policy",
  "index.lifecycle.rollover_alias": "netflow-alias",
  "index.lifecycle.indexing_complete": "true",
  "index.number_of_replicas": "1"
}

```

But the rolled over index ends up being named:

```
netflow-2019.03.29-000002
```

---

<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:** [April 26, 2019, 3:53pm UTC](https://discuss.elastic.co/t/using-ilm-with-netflow-module/173969/8 "2019-04-26T15:53:32Z")

</div>

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