Raspberry Pi – as a ’syslog‘ server using rsyslog

raspberrypi_logo.jpg   Syslog is a client/server protocol that deals with the generation, transmission, and storage of system messages. The purpose of syslog as the name indicates is to write system messages to a log file – each system message is supposed to result in an entry in the log file. A system administrator can analyze the messages in the log file as needed and the log file may be stored locally on the device generating system messages as well as on a remote logging host

# apt-get update
# apt-get upgrade -y
# apt-get install rpi-update
# rpi-update
# apt-get clean
# apt-get install rsyslog
# vi /etc/rsyslog.conf
# provides UDP syslog reception
$ModLoad imudp

$UDPServerRun 514
# provides TCP syslog reception
$ModLoad imtcp

$InputTCPServerRun 514
# vi /etc/rsyslog.d/loghost.conf
# Logfile for each host
$template DynaFile,“/var/log/syslog-%HOSTNAME%.log“
*.* -?DynaFile
# service rsyslog restart
# tail -f /var/log/messages
# echo „This is a test message over tcp“ | nc [loghost-ip-adresse] 514
# vi /etc/rsyslog.d/logclient.conf
*.* @@[loghost-ip-adresse]:514
# logger „This is a test message“

SyslogServer_01

Leave a Reply

You must be logged in to post a comment.