To edit the rsyslog.conf file, open /etc/rsyslog.conf with a text editor (For example, vi or nano) and run the following command:
ADDITIONAL INFORMATION:
sudo vi /etc/rsyslog.conf
To uncomment UDP module, locate and uncomment the lines that load the UDP input modules and define their respective ports (typically 514) and run the following command:
To uncomment TCP module, locate and uncomment the lines that load the TCP input modules and define their respective ports (typically 514) and run the following command:
To define a template for remote logs, add a template to organize logs from different hosts into separate files or directories. For example, to store logs for each host in /var/log/syslog/, run the following command:
To route logs based on criteria, add rules to direct logs to specific files based on their source IP address, facility, or priority. For example, to use the PerHostLog template for all incoming logs: