Remote logging with Syslogd, can I change the hostname?

Solution 1:

Try using syslog-ng. I ran into a number of problems with syslogd on openwrt. I suspect you are running into the similar problems. See my documentation on using syslog-ng with openwrt. My logging server is Ubuntu running rsyslogd.

Alternatively, you should be able to do the required changes on the logging server using syslog-ng to rerwrite the log message based on the sending server.

Solution 2:

This is a known problem with syslogd. Hostnames are not preserved across hosts.

http://novosial.org/logging/syslogd-problems/

As suggested, try using syslog-ng.

Solution 3:

Piping the syslog message to netcat will add the hostname.

A simple way is to pipe messages using netcat (nc) in the syslog.conf file as follow:

*.* "TAB" | nc RemoteLogServer -u 514 -w 1"

A TAB character must be inserted before the pipe symbol.