Setup Filebeat to run as a service

I've setup Filebeat on AWS Amazon Linux 2 AMI using the setup instruction here : (Filebeat quick start: installation and configuration | Filebeat Reference [7.16] | Elastic)

So basically :
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.16.2-linux-x86_64.tar.gz
tar xzvf filebeat-7.16.2-linux-x86_64.tar.gz

To start filebeat per instructions use:
sudo ./filebeat -e

That is not running as a service or in the background so if you get out of that SSH session filebeat stops parsing the logs.
For DEB or RPM you can use sudo service filebeat start , but that does not work for aws linux ami.

How do you setup filebeat to run as a service for aws linux ?

You will need to create a service file manually, maybe this tutorial can help with that.

For DEB or RPM you can use sudo service filebeat start , but that does not work for aws linux ami.

Have you tried? Amazon Linux is a rpm based system, so you should be able to install filebeat using the RPM distribution without any problem, this would create the service file for you.

I reinstalled using the suggested rpm install instructions. All good now.
thanks for your help!

1 Like

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