The collector gets a machine's lines only if that machine's rsyslog sends them itself — this takes a forwarding rule.
A rule's action can be another machine's address: then rsyslog sends a copy of the line over the network, which is forwarding (in the Wiki). The standard syslog port is 514, and the sign before the address sets the protocol:
The same action in the newer syntax is action(type="omfwd" target="10.0.0.5" port="514" protocol="tcp"). Your own rule goes into a separate file in /etc/rsyslog.d ending in .conf: the package's files will be updated, and yours will stay. rsyslog reads its rules at startup, so an edit takes two commands: sudo rsyslogd -N1 checks the syntax of all the files (in the Wiki) without touching the running service, and sudo systemctl restart rsyslog applies the rules.
Only new lines are forwarded: what rsyslog wrote before the rule stays in the machine's own files. Delivery is checked with a test logger line — on the collector it lands in the directory named after the machine.
Forward the lines to the collector
Make this machine's rsyslog forward all of its lines to the collector at 127.0.0.1:514 over TCP. The setting must stay after rsyslog restarts.
Goals · 0 of 2
- Get the machine's lines to the collector not done yet
- Keep forwarding in the rsyslog settings not done yet