Reputation: 41
How do I collect host's syslog
from with in a docker container running in the same host?
Upvotes: 1
Views: 274
Reputation: 616
One way to do this would be to mount the host's log directory into the container that runs your log collector of choice. E.g:
docker run -d -v /var/log/:/path/in/container/ logstash <logstash options ...>
Note that you should be mounting the directory as opposed to the logfile itself. If you bind-mount the file, collection will cease after each log rotation, until you restart the container.
Upvotes: 1