[syslog-ng]Issue with Macros & 1.6.0rc2
Dan Edwards
syslog-ng@lists.balabit.hu
Thu, 17 Apr 2003 18:02:07 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_003A_01C3050B.75F140B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
I am having some strange problems that I can not seem to resolve with
syslog-ng and macro use. I am sure it is simple and I am just over
looking it. When I try and use the $YEAR, $MONTH, $DAY, $FACILITY,
$LEVEL and several other macros nothing is outputted. Example:
destination d_cisco { file("/var/log/cisco-$YEAR.$MONTH.$DAY.log"); }
The file that it creates is:
"/var/log/cisco-.log"
This holds true for usage of template command in the file call. If I
format it with those macros a blank space is all that is entered. If I
put a "\n" on the end of the last macro it erases all the output for the
line and makes the entire line blank. Example:
destination d_cisco { file("/var/log/cisco.log"
template("$YEAR-$MONTH-$DAY $LEVEL $MSG\n")); }
The output is
" "
If I do not put the \n on the end only the MSG macro will output. Any
input is greatly appreciated.
Debian 3.0r1
Syslog-ng-1.6.0rc2
Libol-0.3.9
Dan Edwards
Network Specialist
A. Duda & Sons, Inc.
------=_NextPart_000_003A_01C3050B.75F140B0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I am having some strange problems that I can not seem =
to
resolve with syslog-ng and macro use. I am sure it is simple and I =
am
just over looking it. When I try and use the $YEAR, $MONTH, $DAY,
$FACILITY, $LEVEL and several other macros nothing is outputted. =
Example:</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>destination d_cisco { =
file("/var/log/cisco-$YEAR.$MONTH.$DAY.log");
}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The file that it creates is:</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>“/var/log/cisco-…log”</span></font><=
/p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>This holds true for usage of template command in the =
file
call. If I format it with those macros a blank space is all that =
is
entered. If I put a “\n” on the end of the last macro =
it
erases all the output for the line and makes the entire line blank. =
Example:</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>destination d_cisco { =
file("/var/log/cisco.log"
template(“$YEAR-$MONTH-$DAY $LEVEL $MSG\n”)); =
}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The output is</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>“  =
; “</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>If I do not put the \n on the end only the MSG macro =
will
output. Any input is greatly appreciated. </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Debian 3.0r1</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Syslog-ng-1.6.0rc2</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Libol-0.3.9</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Dan Edwards</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Network Specialist</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>A. Duda & Sons, Inc.</span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'> </span></font></p>
</div>
</body>
</html>
------=_NextPart_000_003A_01C3050B.75F140B0--