How to configure filebeat to restart automatically when it stopped or strucked , when it is runningwith elastic beanstalk app

Hi,

I am new to Filebeat. Right now I configured the filebeat in elasticbeanstalk app to collect the logs and sends to logstash. In unit testing I stopped the filebeat, but it didn't restart automatically.
How can I achieve that, running filebeat without interruptions?
files:
"/etc/filebeat/filebeat.yml":
mode: "000755"
owner: root
group: root
content: |
filebeat.inputs:
- type: log
paths:
- /var/log/nginx/access.log
fields:
type: nginx_access
app_name: nginx
account_number: xxxx
region: us-east-1
service: xxxx
log_level: access
fields_under_root: true
- type: log
paths:
- /var/log/nginx/error.log
fields:
type: nginx_error
app_name: nginx
account_number: xxxx
region: us-east-1
service: xxxx
log_level: error
fields_under_root: true
output.logstash:
hosts: ["xxxxxxx:5044"]
setup.ilm.enabled: false
commands:
1_command:
command: "curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-oss-7.5.1-x86_64.rpm"
cwd: /home/ec2-user
2_command:
command: "rpm -ivh --replacepkgs filebeat-oss-7.5.1-x86_64.rpm"
cwd: /home/ec2-user
3_command:
command: "/etc/init.d/filebeat start"

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