# Can include sub-configuration

**URL:** <https://discuss.elastic.co/t/can-include-sub-configuration/103287>\
**Category:** Beats\
**Created:** [October 10, 2017, 4:01am UTC](https://discuss.elastic.co/t/can-include-sub-configuration/103287 "2017-10-10T04:01:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RomainXie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romainxie/32/22427_2.png) [@RomainXie](https://discuss.elastic.co/u/RomainXie)\
**Post date:** [October 10, 2017, 4:01am UTC](https://discuss.elastic.co/t/can-include-sub-configuration/103287/1 "2017-10-10T04:01:28Z")

</div>

Hi,

There is filebeat & metricbeat in my machine. Some configuration is same in these yml file, like output elasticsearch or some customize fields.

Can I write the same things in a config-file, and then include it in others?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [October 10, 2017, 11:51am UTC](https://discuss.elastic.co/t/can-include-sub-configuration/103287/2 "2017-10-10T11:51:39Z")

</div>

There is no 'include' support in beats config files. But you can specify multiple configuration files by using `-c` multiple times. Like `filebeat -c /etc/filebeat/filebeat.yml -c /etc/beats/output.yml ...`.

Per beats settings are 'namespaced' If fields/tags/processors and outputs are exactly the same, you can even put all settings into one configuration file. Filebeat/Metricbeat 6.0 even supports loading modules from other directories.

e.g.

```auto
filebeat:
  ...

metricbeat:
  ...

output.elasticsearch:
  ...

```

Filebeat will ignore the metricbeat namespace when loading.

---

<div class="post-metadata">

**Author:** ![RomainXie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romainxie/32/22427_2.png) [@RomainXie](https://discuss.elastic.co/u/RomainXie)\
**Post date:** [October 10, 2017, 12:55pm UTC](https://discuss.elastic.co/t/can-include-sub-configuration/103287/3 "2017-10-10T12:55:20Z")

</div>

Thanks a lot.

I run the beats as a service in linux. How can I set the configure file for it?

And can change the default configure file settings in the 6.0 version?

---

<div class="post-metadata">

**Author:** ![RomainXie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romainxie/32/22427_2.png) [@RomainXie](https://discuss.elastic.co/u/RomainXie)\
**Post date:** [October 10, 2017, 6:33pm UTC](https://discuss.elastic.co/t/can-include-sub-configuration/103287/4 "2017-10-10T18:33:50Z")

</div>

> [@steffens](#):
>
> There is no 'include' support in beats config files. But you can specify multiple configuration files by using `-c` multiple times. Like `filebeat -c /etc/filebeat/filebeat.yml -c /etc/beats/output.yml ...`.
> 
> Per beats settings are 'namespaced' If fields/tags/processors and outputs are exactly the same, you can even put all settings into one configuration file. Filebeat/Metricbeat 6.0 even supports loading modules from other directories.
> 
> e.g.
> 
> ```auto
> filebeat:
> ...
> 
> metricbeat:
> ...
> 
> output.elasticsearch:
> ...
> 
> ```
> 
> Filebeat will ignore the metricbeat namespace when loading.

The problem is resolved.

I modify the service file, change the args.

Thank you.

---

<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:** [October 31, 2017, 4:01am UTC](https://discuss.elastic.co/t/can-include-sub-configuration/103287/5 "2017-10-31T04:01:33Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
