With numerous devices on my network, it’s useful to be able to see log files in one central place. There’s software that can do this, but it’s neither lightweight nor necessarily free.
Here’s the three magic lines to put in /etc/syslog-ng/conf.d/remote.conf:
source s_net { udp(ip(0.0.0.0) port(514)); };
destination d_remote { file("/var/log/remote.log"); };
log { source(s_net); destination(d_remote); };
It’s as straightforward as that.
The ‘s_net’ source will match any UDP traffic on port 514. Beware that it will match all traffic from legitimate and non-legitimate sources, so consider firewalling.
The ‘d_remote’ statement will send anything to /var/log/remote.log.
The ‘log’ statement will put the source and destination together, and actually log data.
It’s as straightforward as that!