# Custom Fields with Module Config

**URL:** <https://discuss.elastic.co/t/custom-fields-with-module-config/174601>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 29, 2019, 7:29pm UTC](https://discuss.elastic.co/t/custom-fields-with-module-config/174601 "2019-03-29T19:29:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattz](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mattz](https://discuss.elastic.co/u/mattz)\
**Post date:** [March 29, 2019, 7:29pm UTC](https://discuss.elastic.co/t/custom-fields-with-module-config/174601/1 "2019-03-29T19:29:46Z")

</div>

Is it possible to use custom fields within module config file? What is the appropriate hierarchy?

For example in apache2 module

```
- module: apache2
  access:
    enabled: true
    var.paths: ["/var/log/apache2/access.log", "/var/log/apache2/other_vhosts_access.log"]
    fields:
      token: <my-token-here>
      type: apache_access

```

I don't have any issues using "fields" dictionary within inputs but I'm not seeing the custom fields added when using "fields" inside modules.d/apache2.yml

---

<div class="post-metadata">

**Author:** ![Michal\_Pristas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michal_pristas/32/46639_2.png) [@Michal\_Pristas](https://discuss.elastic.co/u/Michal_Pristas)\
**Post date:** [April 1, 2019, 1:49pm UTC](https://discuss.elastic.co/t/custom-fields-with-module-config/174601/2 "2019-04-01T13:49:09Z")

</div>

Hey @mattz  
Please take a look at [configuring templates (link)](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-template.html) and make sure you have **`append_fields`** configured.

if this does not help you can try to run  
`./filebeat setup --template`  
on top of that

---

<div class="post-metadata">

**Author:** ![mattz](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mattz](https://discuss.elastic.co/u/mattz)\
**Post date:** [April 1, 2019, 6:02pm UTC](https://discuss.elastic.co/t/custom-fields-with-module-config/174601/3 "2019-04-01T18:02:29Z")

</div>

unfortunately I don't have access to elasticsearch.

---

<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:** [April 29, 2019, 6:02pm UTC](https://discuss.elastic.co/t/custom-fields-with-module-config/174601/4 "2019-04-29T18:02:31Z")

</div>

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