I'm trying to configure rsyslog
to receive logs sent from other devices on port 3100 (my manager chose that port and I will get him to change it to 514 later), and save (append) those logs in local files. So I created /etc/rsyslog.d/remote.conf
thus:
$umask 0000
template(name="DynFile" type="string" string="/var/log/remote/%$YEAR%-%$MONTH%-%$DAY%/%HOSTNAME%")
ruleset(name="RemoteMachine"){ action(type="omfile" dynaFile="DynFile" dirCreateMode="0755") }
# provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="3100")
# provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="3100")
#Enable sending system logs over UDP to rsyslog server
*.* @rsyslog-ip-address:3100
#Enable sending system logs over TCP to rsyslog server
*.* @@rsyslog-ip-address:3100
#Set disk queue when rsyslog server will be down:
$ActionQueueFileName queue
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1
added debuggery to the systemd
unit:
ExecStart=/usr/sbin/rsyslogd -n -d
then restarting rsyslog
:
systemctl daemon-reload
systemctl restart rsyslog
then reviewing the port bindings:
# ss -tulpn|grep 3100
udp UNCONN 0 0 *:3100 *:* users:(("rsyslogd",pid=11899,fd=5))
udp UNCONN 0 0 :::3100 :::* users:(("rsyslogd",pid=11899,fd=6))
tcp LISTEN 0 25 *:3100 *:* users:(("rsyslogd",pid=11899,fd=7))
tcp LISTEN 0 25 :::3100 :::* users:(("rsyslogd",pid=11899,fd=8))
so it looks like rsyslog
is listening as per the configuration file; however, the last few lines of journalctl -e -u rsyslog
are:
Sep 05 16:10:22 office-zabbix-proxy systemd[1]: Starting System Logging Service...
Sep 05 16:10:22 office-zabbix-proxy liblogging-stdlog[11899]: [origin software="rsyslogd" swVersion="8.24.0" x-pid="11899" x-info="http://www.rsyslog.com"] start
Sep 05 16:10:22 office-zabbix-proxy systemd[1]: Started System Logging Service.
Sep 05 16:10:22 office-zabbix-proxy liblogging-stdlog[11899]: action 'action 1' suspended, next retry is Mon Sep 5 16:10:52 2022 [v8.24.0 try http://www.rsyslog.com/e/2007 ]
Sep 05 16:10:22 office-zabbix-proxy liblogging-stdlog[11899]: action 'action 2' suspended, next retry is Mon Sep 5 16:10:52 2022 [v8.24.0 try http://www.rsyslog.com/e/2007 ]
I presume these 'actions' correspond to the two module/input declarations in the configuration file, but I have no idea why they have been 'suspended', whether or not it matters, and what I should do about it.
However, there are no files under /var/log/remote/
(which exists, with 0777 permissions) so I presume something is stopping the configuration from doing what I want. The OS is Debian 11 and is not in SELinux mode. Help please?