Categories
Syslog-NG

Collect log messages by Syslog-NG

Recently I had to collect log files from a couple remote hosts with Syslog-NG. I found a pretty good config which separates the log files in different folders based on the hostname. Ubuntu Syslog-NG server: vi /etc/syslog-ng/syslog-ng.conf source s_net { udp( ip(SYSLOG-SERVER-IP) port(514) ); tcp( ip(SYSLOG-SERVER-IP) port(514) ); }; destination d_remotehosts { file(“/var/log/remote-hosts/$HOST/$YEAR-$MONTH-$DAY.log” create_dirs(yes) dir_owner(root) […]