Filebeat stops in docker container

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.

Hi @fdbatista!

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

Thanks!

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!

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