Rsyslogd configuration

Hi community,
I would like to use rsyslog on Openwrt to log also external TCP sources (i.e. IoT devices connected to OpenWrt).
I have read several guides on how to setup the rsyslog.conf file and I ended up with this config:

module (load="imuxsock")
module (load="imklog")
module(load="imudp")
input(type="imudp" port="514")
#Module (load="imtcp")
#Input (type="imtcp" port="514")

If $fromhost-ip == "192.168.1.10" then {
Action (type="omfile" file="/mnt/sda1/log/test.log")
}

$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

*.info;mail.none;authpriv.none;cron.none  /mnt/sda1/log
authpriv.*                                /var/log/secure
mail.*                                    /var/log/maillog
cron.*                                    /var/log/cron
local7.*                              /var/log/boot.log

But nothing is happening :frowning:
Even if the TCP device is generating logs every 30 seconds, nothing is written in the test.log file.
I have also tried changing TCP and UDP but no results.

Thanks for supporting a Newbie!
Ugo

tcpdump the incoming traffic, see if there's actually anything being sent to your rsyslog.

1 Like

Hi frollic,
problem solved!!!
I installed tcpdump as suggested and identified "syslog" from expected tcp source. The incoming request was there.
I then decided to rebuild completly from scratch rsyslog.conf, enabling udp:514, save, restart the service and... voilà, log is created.
Thank you very much for the hint, and the speed of response.
ugo