mirror of
https://github.com/krislamo/graylog_demo
synced 2024-12-16 06:50:35 +00:00
Export Docker logs to rsyslog
Set Docker log driver to syslog and enabled TCP rsyslog reception
This commit is contained in:
parent
cb1d489c6c
commit
79c9a18947
4
Vagrantfile
vendored
4
Vagrantfile
vendored
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"log-driver": "gelf",
|
||||
"log-opts": {
|
||||
"gelf-address": "tcp://172.28.128.30:12201"
|
||||
"log-driver": "syslog",
|
||||
"log-opts": {
|
||||
"syslog-address": "tcp://127.0.0.1:514"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user