[syslog-ng] change localhost to actual hostname in log entries

deet someword at gmail.com
Fri Jun 10 22:16:36 CEST 2005


   Hello.
   I'm running the Suse supplied (SLES9) version of syslog-ng (version
1.6.5-10).
I have a few hosts that are logging everything to a central log
server.    The syslog-ng process on the client hosts is listening on
the loopback interface on port 514 for inbound syslog writes from
applications that cannot use /dev/log.  The problem is that the log
entries get written as being from localhost  (example below)

Jun 10 11:35:04 localhost tomcat: INFO: 2005-06-10 11:35:04,103
[StoreLoader] - Find registry server-registry.xml at classpath
resource

   Obviously this is not much of a problem when your looking at the
logs on the client host that created the log entry.    But on the
central log server i'm sorting logs by $HOST and end up with all the
logs from various clients which appear to be from "localhost" all get
mixed together and written to one file which is confusing.

   So my question is 2 fold.

     On the client is it possible to change the hostname from
"localhost" to the actual hostname via  a syslog-ng configuration on
the client before the logs get written to disk and sent the remote
syslog server?

    If that is not possible are their any syslog-ng ways to accomplish
the goal of changing "localhost" to the correct hostname either on the
client or on the syslog server.
   TIA.   Deet.


More information about the syslog-ng mailing list