Start Filebeat in the foreground for supervisord

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

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.

You will want to use a command that's similar to what Filebeat uses for systemd.

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.

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