[syslog-ng] specifying hostname for unix-stream sources
Nate Campi
nate at campin.net
Fri Jun 17 15:19:15 CEST 2005
On Wed, Jun 15, 2005 at 09:28:09AM -0500, william.batt at abnamro.com wrote:
> This may sound like a strange request, but I would like to override the
> default hostname for messages originating from unix-stream sources. The
> hostname (understandably) defaults to the server hostname. For
> "corporate" reasons I cannot change the hostname but need the syslog-ng
> messages to contain the hostname of a subinterface associated with my
> application. Also for "corporate" reasons I cannot completely replace
> syslog but need to run syslog-ng in parallel with it using separate
> sockets (e.g., /dev/log-ng). Is this possible?
Use templates and specify the hostname manually:
source s_internal { unix-stream("/dev/log"); };
destination d_file {
file("/var/log/messages" template("$ISODATE corphost $PROGRAM $MESSAGE"));
};
log {
source(s_internal); destination(d_file);
};
Pretty simple.
--
Nate
"The C Programming Language - A language which combines the flexibility
of assembly language with the power of assembly language."
More information about the syslog-ng
mailing list