Vishwanath
Vishwanath

Reputation: 41

How to collect host syslog from with in a docker container

How do I collect host's syslog from with in a docker container running in the same host?

Upvotes: 1

Views: 274

Answers (1)

ebr
ebr

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

Related Questions