[syslog-ng] specifying hostname for unix-stream sources
william.batt at abnamro.com
william.batt at abnamro.com
Fri Jun 17 16:29:30 CEST 2005
On 06/17 08:19 AM, Nate Campi <nate at campin>net> wrote:
>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>"
>
>_______________________________________________
>syslog-ng maillist - syslog-ng at lists>balabit>hu
>https://lists>balabit>hu/mailman/listinfo/syslog-ng
>Frequently asked questions at http://www>campin>net/syslog-ng/faq>html
>
Yes, simple for one destination but laborious for many. I was hoping
there was some way to force it with undocumented environment variables or
command line options. For a potential future enhancement, a configuration
syntax similar to one of the following would be nice:
source s_local { unix-stream("/dev/log-ng" hostname("virtualHostName") );
};
-or-
options { myhostname("virtualHostName") ; };
I'm willing to propose a patch if people think it would be of general
interest.
Thanks,
Bill
---------------------------------------------------------------------------
This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change.
ABN AMRO Bank N.V. (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------
More information about the syslog-ng
mailing list