# How to load filebeat or elastic config from a non-default location

**URL:** <https://discuss.elastic.co/t/how-to-load-filebeat-or-elastic-config-from-a-non-default-location/147289>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [September 5, 2018, 2:32am UTC](https://discuss.elastic.co/t/how-to-load-filebeat-or-elastic-config-from-a-non-default-location/147289 "2018-09-05T02:32:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![motamedi791](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@motamedi791](https://discuss.elastic.co/u/motamedi791)\
**Post date:** [September 5, 2018, 2:32am UTC](https://discuss.elastic.co/t/how-to-load-filebeat-or-elastic-config-from-a-non-default-location/147289/1 "2018-09-05T02:32:36Z")

</div>

I am using filebeat on my Linux machine as a service (i.e. sudo service start filebeat). The service is started with the config file from the default location:

```
● filebeat.service - Filebeat sends log files to Logstash or directly to Elasticsearch.
   Loaded: loaded (/lib/systemd/system/filebeat.service; enabled; vendor preset: enabled)
     Docs: https://www.elastic.co/products/beats/filebeat
 Main PID: 4097 (filebeat)
   CGroup: /system.slice/filebeat.service
           └─4097 /usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat.yml -path.home /usr/share/filebeat -path.

systemd[1]: Started Filebeat sends log files to Logstash or directly to Elasticsearch..

```

How can I tell the service to load the config file from another location?

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [September 5, 2018, 11:02am UTC](https://discuss.elastic.co/t/how-to-load-filebeat-or-elastic-config-from-a-non-default-location/147289/2 "2018-09-05T11:02:51Z")

</div>

You can do it as you would do it for other systemd services. You can either edit the service file under `/lib/systemd/system` and change the config path to the desired one.

```auto
[Service]
ExecStart=/usr/share/filebeat/bin/filebeat -c {{ path-to-your-config }} -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat

```

Or you can override the option as described here: [https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services](https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services)

---

<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 3, 2018, 11:03am UTC](https://discuss.elastic.co/t/how-to-load-filebeat-or-elastic-config-from-a-non-default-location/147289/3 "2018-10-03T11:03:04Z")

</div>

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