1
0
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:
Kris Lamoureux 2020-01-29 16:28:17 -05:00
parent cb1d489c6c
commit 79c9a18947
Signed by: kris
GPG Key ID: A30022791E1719A4
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

View File

@ -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"
}
}