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

**URL:** https://discuss.elastic.co/t/how-to-configure-filebeat-to-restart-automatically-when-it-stopped-or-strucked-when-it-is-runningwith-elastic-beanstalk-app/216491
**Category:** Beats
**Created:** [January 24, 2020, 9:17pm UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-restart-automatically-when-it-stopped-or-strucked-when-it-is-runningwith-elastic-beanstalk-app/216491 "2020-01-24T21:17:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![souji](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@souji](https://discuss.elastic.co/u/souji)
#### Post date: [January 24, 2020, 9:17pm UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-restart-automatically-when-it-stopped-or-strucked-when-it-is-runningwith-elastic-beanstalk-app/216491/1 "2020-01-24T21:17:03Z")

</div>

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](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"

---

<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: [February 21, 2020, 11:17pm UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-restart-automatically-when-it-stopped-or-strucked-when-it-is-runningwith-elastic-beanstalk-app/216491/2 "2020-02-21T23:17:10Z")

</div>

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