# Filebeat Index Template from Modules

**URL:** https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660
**Category:** Beats
**Tags:** beats-module, filebeat
**Created:** [July 26, 2020, 2:36pm UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660 "2020-07-26T14:36:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tactics](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tactics](https://discuss.elastic.co/u/tactics)
#### Post date: [July 26, 2020, 2:36pm UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/1 "2020-07-26T14:36:36Z")

</div>

Hi,

Not sure if I am overcomplicating things and bothering unnecessarily...

I have finally got apache logs importing nicely using Filebeat and the Apache module.

I am simply using the fields.yml and therefore the index template is massive... Is there any way to only include the fields that are used in the module or maybe use the Index to generate fields and mappings that are being used?

Maybe I don't actually need to worry about this as the field definitions and mappings don't take up space or cause issues... The only downside I can see is when viewing data to make new searches etc there is a huge number of fields to scroll through!

Any help, advice or reassurance greatly appreciated.

---

<div class="post-metadata">

### Author: ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)
#### Post date: [July 27, 2020, 8:54am UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/2 "2020-07-27T08:54:48Z")

</div>

I'm not quite convinced if there is an easy workaround for you. You can review the `Ingest Management` feature in Kibana, which changes a bit the approach on how fields are defined and limit them only to required ones.

---

<div class="post-metadata">

### Author: ![tactics](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tactics](https://discuss.elastic.co/u/tactics)
#### Post date: [July 27, 2020, 11:03am UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/3 "2020-07-27T11:03:14Z")

</div>

Thanks mtojek, I had looked at that! Trying another route as well so will report back if I manage to get anything working. 3.7GB of logs translated to a 6.3GB Elastic index, so not a complete nightmare but have a feeling this might be reduced with less data fields?

---

<div class="post-metadata">

### Author: ![tactics](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tactics](https://discuss.elastic.co/u/tactics)
#### Post date: [July 27, 2020, 2:07pm UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/4 "2020-07-27T14:07:37Z")

</div>

@mtojek - just tried copying the fields.yml and opening it in Sublime text, this allows me to collapse field groups:

 ![filebeat-fields-elastic](https://us1.discourse-cdn.com/elastic/original/3X/8/3/8369d55c8886438b93d84b8725fcd35112333ffb.jpeg)

I then removed the ones that weren't needed:

![filebeat-fields-apache](https://us1.discourse-cdn.com/elastic/original/3X/6/1/612b136b0e832d846679f886010ba44f418e080d.jpeg)

My original index template JSON file had 1,007 lines and the mappings had 16,172 lines. I saved the new fields as apache-fields.yml - updated this in filebeat.yml and then changed all of the index and template settings so a new index patten was used.

Ran filebeat setup and the new index template JSON file has 364 lines and the mappings has 3,242 lines.

Ran a test import on one log file - the Kibana [Filebeat Apache] Access and error logs ECS Dashboard works nicely still (change setup.dashboards.index: to reflect the new index names and updated templates) so seems to be fine.

Just running the same log files (14 million lines) into the system and will report back if there is a size difference or not. Should have recorded time on the first import as well to see if that changes as well but will probably run the imports again later on so can always check then.

---

<div class="post-metadata">

### Author: ![tjfred](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tjfred](https://discuss.elastic.co/u/tjfred)
#### Post date: [July 30, 2020, 1:49pm UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/5 "2020-07-30T13:49:30Z")

</div>

what was the actual problem you were facing by having all the fields present in fields.yml?

---

<div class="post-metadata">

### Author: ![tjfred](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tjfred](https://discuss.elastic.co/u/tjfred)
#### Post date: [July 30, 2020, 2:21pm UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/6 "2020-07-30T14:21:16Z")

</div>

fields in the template that are not used are not going to take up space in your elasticsearch index. perhaps you are suffering with this bug: [Filebeat's default index mapping causes Kibana to display many empty date fields](https://discuss.elastic.co/t/filebeats-default-index-mapping-causes-kibana-to-display-many-empty-date-fields/238324) (now fixed)

---

<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 27, 2020, 4:21pm UTC](https://discuss.elastic.co/t/filebeat-index-template-from-modules/242660/7 "2020-08-27T16:21:16Z")

</div>

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