[syslog-ng]how to make program destination

David Monk david@purplebear.net
Tue, 15 Jan 2002 10:34:19 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_0052_01C19DB0.3052C420
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am fairly new to central logging with syslog-ng and had a couple =
questions. I tried briefly looking to the mailing list archives, but I =
couldn't find any way to easily search it.

I want to have some matched log entries from various hosts sent to the =
network admin staff. What would be most preferential is to have the =
source hostname in the subject line and the log message as the body. I =
defined the following:

destination d_mail { program("mail -s \"Matched log entry from $HOST\" =
syslog); };

With this I DO get an email, but the $HOST macro is empty and the =
message body is also empty. Is there a better method? Or can anyone help =
with an example or two?

Thanks,
David Monk CCNA, MCSE
david@purplebear.net



------=_NextPart_000_0052_01C19DB0.3052C420
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4912.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am fairly new to central logging with =
syslog-ng=20
and had a couple questions. I tried briefly looking to the mailing list=20
archives, but I couldn't find any way to easily search it.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I want to have some matched log entries =
from=20
various hosts sent to the network admin staff. What would be most =
preferential=20
is to have the source hostname in the subject line and the log message =
as the=20
body. I defined the following:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>destination d_mail { program("mail -s =
\"Matched log=20
entry from $HOST\" syslog); };</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>With this I DO get an email, but the =
$HOST macro is=20
empty and the message body is also empty. Is there a better method? Or =
can=20
anyone help with an example or two?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>David Monk CCNA, MCSE</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"mailto:david@purplebear.net">david@purplebear.net</A></FONT></DIV=
>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0052_01C19DB0.3052C420--