# Manage ILM with ingestion pipeline

**URL:** <https://discuss.elastic.co/t/manage-ilm-with-ingestion-pipeline/220223>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 20, 2020, 4:05pm UTC](https://discuss.elastic.co/t/manage-ilm-with-ingestion-pipeline/220223 "2020-02-20T16:05:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Bevione](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/federico_bevione/32/48231_2.png) [@Federico\_Bevione](https://discuss.elastic.co/u/Federico_Bevione)\
**Post date:** [February 20, 2020, 4:05pm UTC](https://discuss.elastic.co/t/manage-ilm-with-ingestion-pipeline/220223/1 "2020-02-20T16:05:08Z")

</div>

Hi there,

Is there a way to manage ILM when the index name is built in the ingestion pipeline?

In my scenario, metricbeats send data, specifing the target pipeline

```auto
output.elasticsearch:
  hosts: ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}"]
  username: "${ELASTICSEARCH_USERNAME}"
  password: "${ELASTICSEARCH_PASSWORD}"
  pipeline: "${ELASTICSEARCH_PIPELINE}"
  ssl:
    verification_mode: full
    certificate_authorities: ["/etc/ssl/elastic/tls.crt"]

```

then, the pipeline splits data based on the metric content.

```json
PUT _ingest/pipeline/my_pipeline
{
  "processors": [
    {
      "set": {
        "field": "_index",
        "value": "my_index"
      }
    },
    {
      "set": {
        "if": "<something>",
        "field": "_index",
        "value": "{{_index}}_foo"
      }
    }
  ]
}

```

I need this in order to be able to give permissions to users only to a specific index set.

In this scenario, **the first index does not exists before the first data and the ILM won't work**.  
Create the first index "manually" would be possible but very very tricky.

---

<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:** [March 19, 2020, 4:05pm UTC](https://discuss.elastic.co/t/manage-ilm-with-ingestion-pipeline/220223/2 "2020-03-19T16:05:25Z")

</div>

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