Syslog server chaining issue

"Maurya, Shivani" <[email protected]> Wed, 11 Dec 2024 12:47:29 +0000
Newsgroups gmane.comp.syslog-ng
Message-ID <DM4PR11MB5502CEFD5DA745E77A7CA2A3903E2@DM4PR11MB5502.namprd11.prod.outlook.com>
--===============7500842639718470961==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DM4PR11MB5502CEFD5DA745E77A7CA2A3903E2DM4PR11MB5502namp_"

--_000_DM4PR11MB5502CEFD5DA745E77A7CA2A3903E2DM4PR11MB5502namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,

I am using 2 syslog servers on version 3.31. The devices are sending syslog=
 message to 1st syslog server. The 1st syslog server is forwarding the same=
 message to 2nd syslog server.

Device --> Syslog Server 1 --> Syslog Server 2

The configurations of 1st syslog server -
Options -
keep-hostname(yes);
use-dns(yes);
use-fqdn(yes);

Destination -
destination d_sec { udp("IP_of_second_syslog" port(514) template("${ISODATE=
}  ${HOST}  ${PRIORITY}  ${MSG}\n") template-escape(no)); };

The configuration of 2nd syslog server -

destination d_syslogFile { file("/var/log/syslog.log" template("${R_ISODATE=
}  ${HOST}  ${PRIORITY}  ${FACILITY}  ${PROGRAM}  ${MSG}\n") template-escap=
e(no)); };

Problem -

When the syslog message is getting logged at 2nd Syslog server, the ${PRIOR=
ITY} of the message is always "notice". And the original severity/priotity =
of the message is getting captured in the ${PROGRAM} macro.
How to capture the priority of the forwarded message on 2nd Syslog server i=
n the ${PRIORITY} macro instead of ${PROGRAM} macro?

Regards,
Shivani Maurya


--_000_DM4PR11MB5502CEFD5DA745E77A7CA2A3903E2DM4PR11MB5502namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:11.0pt;
	font-family:"Aptos",sans-serif;
	mso-ligatures:standardcontextual;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Aptos",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:11.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#467886" vlink=3D"#96607D" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi All,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I am using 2 syslog servers on version 3.31. The dev=
ices are sending syslog message to 1<sup>st</sup> syslog server. The 1<sup>=
st</sup> syslog server is forwarding the same message to 2<sup>nd</sup> sys=
log server.
<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Device <span style=3D"font-family:Wingdings">&agrave=
;</span> Syslog Server 1
<span style=3D"font-family:Wingdings">&agrave;</span> Syslog Server 2<o:p><=
/o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">The configurations of 1<sup>st</sup> syslog server -=
<o:p></o:p></p>
<p class=3D"MsoNormal"><b>Options -<o:p></o:p></b></p>
<p class=3D"MsoNormal">keep-hostname(yes);<o:p></o:p></p>
<p class=3D"MsoNormal">use-dns(yes);<o:p></o:p></p>
<p class=3D"MsoNormal">use-fqdn(yes);<o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none"><o:p>&nbsp;</o:p>=
</span></p>
<p class=3D"MsoNormal"><b><span style=3D"mso-ligatures:none">Destination - =
<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">destination d_sec=
 { udp(&quot;IP_of_second_syslog&quot; port(514) template(&quot;${ISODATE} =
&nbsp;${HOST} &nbsp;${PRIORITY} &nbsp;${MSG}\n&quot;) template-escape(no));=
 };<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none"><o:p>&nbsp;</o:p>=
</span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">The configuration=
 of 2<sup>nd</sup> syslog server &#8211;
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none"><o:p>&nbsp;</o:p>=
</span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">destination d_sys=
logFile { file(&quot;/var/log/syslog.log&quot; template(&quot;${R_ISODATE} =
&nbsp;${HOST} &nbsp;${PRIORITY} &nbsp;${FACILITY} &nbsp;${PROGRAM} &nbsp;${=
MSG}\n&quot;) template-escape(no)); };<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none"><o:p>&nbsp;</o:p>=
</span></p>
<p class=3D"MsoNormal"><b><span style=3D"mso-ligatures:none">Problem &#8211=
; <o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"mso-ligatures:none"><o:p>&nbsp;</o=
:p></span></b></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">When the syslog m=
essage is getting logged at 2<sup>nd</sup> Syslog server, the ${PRIORITY} o=
f the message is always &#8220;notice&#8221;. And the original severity/pri=
otity of the message is getting captured in the
 ${PROGRAM} macro. <o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">How to capture th=
e priority of the forwarded message on 2<sup>nd</sup> Syslog server in the =
${PRIORITY} macro instead of ${PROGRAM} macro?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none"><o:p>&nbsp;</o:p>=
</span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">Regards,<o:p></o:=
p></span></p>
<p class=3D"MsoNormal"><span style=3D"mso-ligatures:none">Shivani Maurya<o:=
p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_DM4PR11MB5502CEFD5DA745E77A7CA2A3903E2DM4PR11MB5502namp_--

--===============7500842639718470961==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq


--===============7500842639718470961==--