# Multiple indexnames from 1 filebeat instance with ilm

**URL:** <https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762>\
**Category:** Beats\
**Tags:** ilm-index-lifecycle-management, filebeat\
**Created:** [April 20, 2021, 8:27pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762 "2021-04-20T20:27:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcel\_van\_Zoggel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcel_van_zoggel/32/81104_2.png) [@Marcel\_van\_Zoggel](https://discuss.elastic.co/u/Marcel_van_Zoggel)\
**Post date:** [April 20, 2021, 8:27pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762/1 "2021-04-20T20:27:20Z")

</div>

I want to use filebeat on a server with 2 different logfolders. Each folder must go to a different indexname. This i can set via a custom field per input (fe. Field log\_type) in combination with

```auto
output.elasticsearch.index: "index-%{[fields.log_type]:other}-%{+yyyy.MM.dd}"

```

For this to work i have to disable ILM.

I want to use ILM to setup different lifetime policy for the inputs.

How do i set this up ?

---

<div class="post-metadata">

**Author:** ![RLPowellJr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rlpowelljr/32/97049_2.png) [@RLPowellJr](https://discuss.elastic.co/u/RLPowellJr)\
**Post date:** [April 21, 2021, 6:34pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762/2 "2021-04-21T18:34:15Z")

</div>

Since ILM doesn't work with the dynamic variable substitution, you may need to create a conditional. Assuming you have two log types, poplar and pine, you could try (note this isn't correct syntax/grammar, just an illustration of the idea):

if fields.log\_type = poplar  
then output.elasticsearch.index: "index-poplar"  
else output.elasticsearch.index: "index-pine"

---

<div class="post-metadata">

**Author:** ![Marcel27](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcel27/32/78264_2.png) [@Marcel27](https://discuss.elastic.co/u/Marcel27)\
**Post date:** [April 21, 2021, 6:54pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762/3 "2021-04-21T18:54:14Z")

</div>

> [@RLPowellJr](#):
>
> output.elasticsearch.index

Thanks, but isn't output.elasticsearch.index ignored when ILM is enabled !?

---

<div class="post-metadata">

**Author:** ![Marcel27](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcel27/32/78264_2.png) [@Marcel27](https://discuss.elastic.co/u/Marcel27)\
**Post date:** [April 22, 2021, 10:10pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762/4 "2021-04-22T22:10:21Z")

</div>

Is 2 filebeat applications running on same machine an (the only) option ?  
(when need for 2 different indexnames with ILM enabled) ?

---

<div class="post-metadata">

**Author:** ![RLPowellJr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rlpowelljr/32/97049_2.png) [@RLPowellJr](https://discuss.elastic.co/u/RLPowellJr)\
**Post date:** [April 26, 2021, 1:57pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762/5 "2021-04-26T13:57:09Z")

</div>

I was pretty sure you could configure Filebeat to support what you want to do, but that doesn't seem possible. I confused myself because I'm using Logstash to route to different indices, as described at [Elasticsearch output plugin | Logstash Reference [7.12] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)

I don't know if two instances of Filebeat can run at the same time.

---

<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 24, 2021, 3:57pm UTC](https://discuss.elastic.co/t/multiple-indexnames-from-1-filebeat-instance-with-ilm/270762/6 "2021-05-24T15:57:17Z")

</div>

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