# Start Filebeat in the foreground for supervisord

**URL:** <https://discuss.elastic.co/t/start-filebeat-in-the-foreground-for-supervisord/77694>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 7, 2017, 4:06pm UTC](https://discuss.elastic.co/t/start-filebeat-in-the-foreground-for-supervisord/77694 "2017-03-07T16:06:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinod\_Rai](https://avatars.discourse-cdn.com/v4/letter/v/a6a055/32.png) [@Vinod\_Rai](https://discuss.elastic.co/u/Vinod_Rai)\
**Post date:** [March 7, 2017, 4:06pm UTC](https://discuss.elastic.co/t/start-filebeat-in-the-foreground-for-supervisord/77694/1 "2017-03-07T16:06:08Z")

</div>

From the official filebeat docs :

> If you use an init.d script to start Filebeat on deb or rpm, you can’t specify command line flags (see Command Line Options). To specify flags, start Filebeat in the foreground.

I'm using Supervisor to run Filebeat but this requires that Filebeat runs as a foreground process. How do I achieve this ? I'm on CentOS 7 and have Filebeat installed using RPM as shown [here](https://www.elastic.co/guide/en/beats/filebeat/current/setup-repositories.html)

I'm currently using **/etc/init.d/filebeat start** to get it started but Filebeat simply prints **Config OK** and returns the control to the user. I want to continue seeing it in the foreground.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 11, 2017, 12:04am UTC](https://discuss.elastic.co/t/start-filebeat-in-the-foreground-for-supervisord/77694/2 "2017-03-11T00:04:10Z")

</div>

You will want to use a command that's similar to what Filebeat uses for [systemd](https://github.com/elastic/beats/blob/v5.2.2/dev-tools/packer/platforms/centos/systemd.j2).

```
command=/usr/share/filebeat/bin/filebeat -e
    -c /etc/filebeat/filebeat.yml 
    -path.home /usr/share/filebeat
    -path.config /etc/filebeat
    -path.data /var/lib/filebeat
    -path.logs /var/log/filebeat

```

The `-e` tells the process to writes its logs to stderr so you can manage logging with `supervisorctl`.

---

<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 8, 2017, 12:04am UTC](https://discuss.elastic.co/t/start-filebeat-in-the-foreground-for-supervisord/77694/3 "2017-04-08T00:04:16Z")

</div>

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