# Define custom fields on root level when using multiple config yml files

**URL:** <https://discuss.elastic.co/t/define-custom-fields-on-root-level-when-using-multiple-config-yml-files/219627>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 17, 2020, 1:10pm UTC](https://discuss.elastic.co/t/define-custom-fields-on-root-level-when-using-multiple-config-yml-files/219627 "2020-02-17T13:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nxtra](https://avatars.discourse-cdn.com/v4/letter/n/e9bcb4/32.png) [@nxtra](https://discuss.elastic.co/u/nxtra)\
**Post date:** [February 17, 2020, 1:10pm UTC](https://discuss.elastic.co/t/define-custom-fields-on-root-level-when-using-multiple-config-yml-files/219627/1 "2020-02-17T13:10:51Z")

</div>

In my main `filebeat.yml` I have  
filebeat.config.inputs:  
enabled: true  
path: /usr/share/filebeat/configs/\*.yml

So I can define multiple config files.  
Each config file specifies a custom field `name` to add.  
However this is always added as a nested field `field.name` .

```
- type: log
  enabled: true
  paths:
    - /var/log/appName.log
  fields:
    name: appName

```

This will give the field `field.appName`. I just want `appName`.  
I tried using `target: ''` but that doesn't work.  
How can I do that?

---

<div class="post-metadata">

**Author:** ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)\
**Post date:** [February 19, 2020, 2:26am UTC](https://discuss.elastic.co/t/define-custom-fields-on-root-level-when-using-multiple-config-yml-files/219627/2 "2020-02-19T02:26:19Z")

</div>

Hi,

[https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#fields-under-root-log](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#fields-under-root-log)

---

<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:** [March 18, 2020, 2:26am UTC](https://discuss.elastic.co/t/define-custom-fields-on-root-level-when-using-multiple-config-yml-files/219627/3 "2020-03-18T02:26:20Z")

</div>

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