# Filebeat won't create custom indices

**URL:** <https://discuss.elastic.co/t/filebeat-wont-create-custom-indices/310988>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 29, 2022, 1:21pm UTC](https://discuss.elastic.co/t/filebeat-wont-create-custom-indices/310988 "2022-07-29T13:21:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![issy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/issy/32/109033_2.png) [@issy](https://discuss.elastic.co/u/issy)\
**Post date:** [July 29, 2022, 1:21pm UTC](https://discuss.elastic.co/t/filebeat-wont-create-custom-indices/310988/1 "2022-07-29T13:21:55Z")

</div>

I'm trying to have custom indices for different filebeat modules.

In this example i want to have a custom indices for the apache module, but it doesn't seem to work.

indices:  
- index: "filebeat-%{[agent.version]}-apache-error"  
when.equals:  
event.module: "apache"

setup.template.enabled: true  
setup.template.name: "filebeat-%{[agent.version]}"  
setup.template.pattern: "filebeat-%{[agent.version]}-\*"  
setup.template.fields: "fields.yml"  
setup.ilm.enabled: false

Any help is appreciated, thanks!

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [July 29, 2022, 4:18pm UTC](https://discuss.elastic.co/t/filebeat-wont-create-custom-indices/310988/2 "2022-07-29T16:18:42Z")

</div>

I doubt it will do the setup for multiple indices. Try creating your own templates and bootstrap the initial indices.

I think your index "when" logic is only valid in the output section.

See [Filebeat- Multiples modules output to multiples indexes.](https://www.linkedin.com/pulse/filebeat-multiples-modules-output-indexes-adepoju-emmanuel/)

FYI - These output methods are completely invalidated by the new data streams obfuscation of indexing.

---

<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:** [August 26, 2022, 6:19pm UTC](https://discuss.elastic.co/t/filebeat-wont-create-custom-indices/310988/3 "2022-08-26T18:19:36Z")

</div>

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