# Filebeat stops in docker container

**URL:** https://discuss.elastic.co/t/filebeat-stops-in-docker-container/226323
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [April 3, 2020, 5:21am UTC](https://discuss.elastic.co/t/filebeat-stops-in-docker-container/226323 "2020-04-03T05:21:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fdbatista](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fdbatista/32/64703_2.png) [@fdbatista](https://discuss.elastic.co/u/fdbatista)
#### Post date: [April 3, 2020, 5:21am UTC](https://discuss.elastic.co/t/filebeat-stops-in-docker-container/226323/1 "2020-04-03T05:21:01Z")

</div>

Hello everyone.

I am trying to feed Logstash via Filebeat using docker containers, and it works fine, except for the fact that Filebeat container stops after reading the files contents.

I want Filebeat to constantly watch my files so I can have a real-time monitoring on my logs and realize if any of them changes without having to start the Filebeat container periodically.

Right now, when I start the container, it reads the log files, sends new data to Logstash and it stops automatically. And everything looks fine, there is no error message or any other sign that it may be caused by an abnormal behaviour, looks like it is configured to work that way.

These are the final lines from the Docker container logs:

`2020-04-03T05:00:27.741Z	INFO	[monitoring]	log/log.go:154	Uptime: 58.196107ms`

`2020-04-03T05:00:27.741Z	INFO	[monitoring]	log/log.go:131	Stopping metrics logging.`

`2020-04-03T05:00:27.741Z	INFO	instance/beat.go:445	filebeat stopped.`

How can I change this behaviour? Is there any setting to prevent this?

Thanks.

---

<div class="post-metadata">

### Author: ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)
#### Post date: [April 3, 2020, 8:50am UTC](https://discuss.elastic.co/t/filebeat-stops-in-docker-container/226323/2 "2020-04-03T08:50:15Z")

</div>

Hi @fdbatista!

Could you share your configuration and any env information so as being able to try to reproduce this one?

Thanks!

---

<div class="post-metadata">

### Author: ![fdbatista](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fdbatista/32/64703_2.png) [@fdbatista](https://discuss.elastic.co/u/fdbatista)
#### Post date: [April 3, 2020, 8:33pm UTC](https://discuss.elastic.co/t/filebeat-stops-in-docker-container/226323/3 "2020-04-03T20:33:00Z")

</div>

Hi, @ChrsMark I found the cause, the container was being launched with the --once flag active. I am a newbie on this, and this is a tutorial I was following, not code written by me, where this part was not explained.

Thanks for your answer!

---

<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: [May 1, 2020, 8:33pm UTC](https://discuss.elastic.co/t/filebeat-stops-in-docker-container/226323/4 "2020-05-01T20:33:00Z")

</div>

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