Log remote hosts to a separate log with syslog in FreeBSD

In FreeBSD you can easily let remote hosts log to your system without installing any third party applications. When doing so you might want to separate your remote hosts logs from the local hosts logs which is also easy to do.

Add this to the bottom of your /etc/syslog.conf on the host accepting the logs:
+otherhost.domain,-@
*.* /path/to/remote-host.log

The trick is @ which is a handy short for the local hostname, so by negating it like above you get the separation you want.

Works on FreeBSD11.0-Current, check man syslog.conf(5) if this doesn’t work for you.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *