Create a log Server with a Raspberry Pi
Update and upgrade the raspberry pi, then install rsyslog:
sudo apt update
sudo apt full-upgrade -y
sudo apt install rsyslog
Create a template file in the /etc/rsyslog.d directory:
cd /etc/rsyslog.d
touch template.conf
where template.conf can be anything provided the suffix is ‘.conf’.
And insert the following in the file ‘template.conf’:
$template filename, "path_to_file/logfile.log
if $fromhost-ip startswith "HOSTIPADDRESS" then -?filename
& stop
where HOSTIPADDRESS is the address of the device sending its logs to the log server.
Then restart the rsyslog service:
sudo systemctl restart rsyslog.service