# ElasticSearch output with alias

**URL:** https://discuss.elastic.co/t/elasticsearch-output-with-alias/228869
**Category:** Elasticsearch
**Created:** [April 20, 2020, 1:15pm UTC](https://discuss.elastic.co/t/elasticsearch-output-with-alias/228869 "2020-04-20T13:15:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Julien1](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Julien1](https://discuss.elastic.co/u/Julien1)
#### Post date: [April 20, 2020, 1:15pm UTC](https://discuss.elastic.co/t/elasticsearch-output-with-alias/228869/1 "2020-04-20T13:15:01Z")

</div>

Hello,

Do we have to configure manualy first time index name in Elasticsearch output ?

Let me explain, the context is :

I create a index named :

`index: "es_on_demand_index-000001"`

I have an index Lifecycle Policies like this :

```
{
  "policy": "policy_exlabel",
  "phase_definition": {
    "min_age": "0ms",
    "actions": {
      "rollover": {
        "max_size": "5mb",
        "max_age": "3d"
      },
      "set_priority": {
        "priority": 100
      }
    }
  },

```

When index is create, I create an alias manualy (alias es\_on\_demand), I stop Filebeat's service, I change Elasticsearch output by the alias name :

`index: "es_on_demand"`

I start Filebeat's service, and when conditions of my ILM are true, a new index is create :

es\_on\_demand\_index-000002

and logs points to the right index.

My question is : Can I create the first time, a alias who points a pattern index even if the index is not created yet ?

Thanks for your help

---

<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: [April 21, 2020, 10:13pm UTC](https://discuss.elastic.co/t/elasticsearch-output-with-alias/228869/2 "2020-04-21T22:13:15Z")

</div>

You can create an ILM policy and an index template that uses an alias, and then create the index.

[Tutorial: Automate rollover with ILM | Elasticsearch Guide [7.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/getting-started-index-lifecycle-management.html) runs through what that looks like.

> [@Julien1](#):
>
> "max\_size": "5mb"

That's super small, is there a reason you've chosen that size?

---

<div class="post-metadata">

### Author: ![Julien1](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Julien1](https://discuss.elastic.co/u/Julien1)
#### Post date: [April 22, 2020, 6:49am UTC](https://discuss.elastic.co/t/elasticsearch-output-with-alias/228869/3 "2020-04-22T06:49:56Z")

</div>

Hi,

Thank you so your support.

I think my issue will be resolved by this help.

Yes 5mb is very small, it's just for test to check if my ILM run correctly.

---

<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: [May 20, 2020, 7:04am UTC](https://discuss.elastic.co/t/elasticsearch-output-with-alias/228869/4 "2020-05-20T07:04:02Z")

</div>

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