1
0
mirror of https://github.com/krislamo/graylog_demo synced 2025-10-23 13:28:33 +00:00

Export Docker logs to rsyslog

Set Docker log driver to syslog and enabled TCP rsyslog reception
This commit is contained in:
2020-01-29 16:28:17 -05:00
parent cb1d489c6c
commit 79c9a18947
2 changed files with 7 additions and 3 deletions

4
Vagrantfile vendored
View File

@@ -40,6 +40,10 @@ Vagrant.configure("2") do |config|
systemctl start rsyslog
systemctl -q enable rsyslog
# Enable TCP syslog reception
sed -i 's/#\$ModLoad imtcp/\$ModLoad imtcp/g' /etc/rsyslog.conf
sed -i 's/#\$InputTCPServerRun 514/\$InputTCPServerRun 514/g' /etc/rsyslog.conf
# Add rsyslog forwarding option if it does not exist
if ! grep -q "#{PRIVATE_NET_IP}:1514" /etc/rsyslog.conf; then
echo "*.* @@#{PRIVATE_NET_IP}:1514;RSYSLOG_SyslogProtocol23Format" >> /etc/rsyslog.conf