# Send output to elastic search specific index with ilm\_rollover?

**URL:** https://discuss.elastic.co/t/send-output-to-elastic-search-specific-index-with-ilm-rollover/317818
**Category:** Beats
**Tags:** ilm-index-lifecycle-management, filebeat
**Created:** [October 31, 2022, 12:05pm UTC](https://discuss.elastic.co/t/send-output-to-elastic-search-specific-index-with-ilm-rollover/317818 "2022-10-31T12:05:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Linux\_Artists](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/linux_artists/32/78559_2.png) [@Linux\_Artists](https://discuss.elastic.co/u/Linux_Artists)
#### Post date: [October 31, 2022, 12:05pm UTC](https://discuss.elastic.co/t/send-output-to-elastic-search-specific-index-with-ilm-rollover/317818/1 "2022-10-31T12:05:49Z")

</div>

Hello,

Running elasticsearch kibana and filebeat I will like to make an index and pattern with ILM.  
On Elasticsearch I did

```auto
          while [["$(curl -s -o /dev/null -w '%{http_code}\n' $ES_URL)" != "200"]]; do sleep 1; done
          curl -X PUT "localhost:9200/_ilm/policy/daily?pretty" -H 'Content-Type: application/json' -d' { "policy": { "phases": { "hot": { "actions": { "rollover": { "max_age": "1d" }, "set_priority": { "priority": 100 } }, "min_age": "0ms"}, "delete": { "min_age": "7d", "actions": { "delete": {} } } } } } '

```

Which is working, now I am trying to make index connect to it.  
I know on Logstash I can do:

# output {

```
# elasticsearch { 
# hosts => "http://elasticsearch-master:9200" 
# index => "myapp"
# ilm_rollover_alias => "myapp"
# ilm_pattern => "000001"
# ilm_policy => "daily"
# ilm_enabled => true
# }
# }

```

How can I do the same setting for the output.elasticsearch: ?

When I tried:

```auto
output.elasticsearch:
        hosts: ["http://elasticsearch-master:9200"]
        index: "myapp-%{[beat.version]}-%{+yyyy.MM.dd}"

setup.template:
        name: 'myapp'
        pattern: 'myapp-*'
        enabled: true

```

But this did not work..

Thank you : )

---

<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: [November 3, 2022, 6:49am UTC](https://discuss.elastic.co/t/send-output-to-elastic-search-specific-index-with-ilm-rollover/317818/2 "2022-11-03T06:49:20Z")

</div>

Welcome to our community! 😃

It's a little hard for me to read that curl request in a long line like that, but this should work;

```auto
output.elasticsearch:
        hosts: ["http://elasticsearch-master:9200"]
        index: daily

```

TLDR you need to set the index to the write alias of the policy, which is commonly the same as the policy name.

---

<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: [December 1, 2022, 8:50am UTC](https://discuss.elastic.co/t/send-output-to-elastic-search-specific-index-with-ilm-rollover/317818/3 "2022-12-01T08:50:19Z")

</div>

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