<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
I don't think adding a custom field to an SNMPv2 trap is possible, but I could be wrong as I'm not an expert in SNMP.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
I didn't find anything either in the net-snmp library or in the RFCs of SNMPv2.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Your option as far as I see is to send the agent-addr in the varbindlist, as SNMPv1 is not sufficient and it is not supported either in syslog-ng.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Nevertheless, I don't know your use case, maybe we can find out a different workaround.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Gabor</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Maurya, Shivani <shivani.maurya@intel.com><br>
<b>Sent:</b> Wednesday, March 23, 2022 7:38<br>
<b>To:</b> Gabor Nagy (gnagy) <Gabor.Nagy@oneidentity.com><br>
<b>Cc:</b> wernli@in2p3.fr <wernli@in2p3.fr>; Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu><br>
<b>Subject:</b> RE: [syslog-ng] Customizing syslog-ng snmp() destination option</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
span.x_EmailStyle20
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-IN" link="blue" vlink="purple" style="word-wrap:break-word">
<div style="background-color:#FFEB9C; width:100%; border-style:solid; border-color:#9C6500; border-width:1pt; padding:2pt; font-size:10pt; line-height:12pt; font-family:'Calibri'; color:Black; text-align:left">
<span style="color:#9C6500; font-weight:bold">CAUTION:</span> This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.</div>
<br>
<div>
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="">Hi Gabor,</span></p>
<p class="x_MsoNormal"><span style=""> </span></p>
<p class="x_MsoNormal"><span style="">Can you please help here?</span></p>
<div>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Regards,</span></p>
<p class="x_MsoNormal"><span lang="EN-US">Shivani Maurya</span></p>
</div>
<p class="x_MsoNormal"><span style=""> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Maurya, Shivani
<br>
<b>Sent:</b> Tuesday, March 22, 2022 10:27 PM<br>
<b>To:</b> Gabor Nagy (gnagy) <Gabor.Nagy@oneidentity.com>; wernli@in2p3.fr; Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu><br>
<b>Subject:</b> RE: [syslog-ng] Customizing syslog-ng snmp() destination option</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"><span style="">Hi Gabor,</span></p>
<p class="x_MsoNormal"><span style=""> </span></p>
<p class="x_MsoNormal"><span style="">We want to use snmpv2v/snmpv3 only going forward. This is the reason I want to add the field “agent-addr”. Is there a way to add “agent-addr” field with snmpv2c/snmpv3 ?</span></p>
<div>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Regards,</span></p>
<p class="x_MsoNormal"><span lang="EN-US">Shivani Maurya</span></p>
</div>
<p class="x_MsoNormal"><span style=""> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="x_MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Gabor Nagy (gnagy) <<a href="mailto:Gabor.Nagy@oneidentity.com">Gabor.Nagy@oneidentity.com</a>>
<br>
<b>Sent:</b> Tuesday, March 22, 2022 8:48 PM<br>
<b>To:</b> Maurya, Shivani <<a href="mailto:shivani.maurya@intel.com">shivani.maurya@intel.com</a>>;
<a href="mailto:wernli@in2p3.fr">wernli@in2p3.fr</a>; Syslog-ng users' and developers' mailing list <<a href="mailto:syslog-ng@lists.balabit.hu">syslog-ng@lists.balabit.hu</a>><br>
<b>Subject:</b> Re: [syslog-ng] Customizing syslog-ng snmp() destination option</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div>
<p class="x_MsoNormal"><span style="color:black">Thanks Shivani for the example!<br>
<br>
I didn't know "agent-addr" is a standardized SNMPv1 trap element.<br>
I've found it in the SNMPv1 RFC too. [1]</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black">Unfortunately, syslog-ng only supports snmpv2c and snmpv3 versions.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black">I've checked the code of snmp-dest() and I think it would be _relatively_ easy to add snmpv1 support.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black">I can open a feature request on GitHub, as I'm not sure when we could get to this in the near future, or is there any reason against SNMPv1.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black"><br>
Regards,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black">Gabor</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black">[1] <a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatatracker.ietf.org%2Fdoc%2Fhtml%2Frfc1157%2F%23section-4.1.6&data=04%7C01%7CGabor.Nagy%40oneidentity.com%7C574fb68ee07141f2da1308da0c97ba6d%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637836143070345948%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=sxX1x%2BMG02oLeVAtBBPjpcMYkXbAzHRvWEvfoh9KQ%2FI%3D&reserved=0" originalsrc="https://datatracker.ietf.org/doc/html/rfc1157/#section-4.1.6" shash="Gm/YeuWYUw2GtdNBzXMpQUWqugGc8SCndpL/D+U4idpZlD3JWSCYw+7JvWgEqpvLLrzkAFDl7jZk/5DaPisR+5gGTYixx0iILmspvhVzz06a17c35XKUHlOB3cuSo/zviF2v8eu69IyTEBjmlSZSWb9Ms0W2mHwQzLjZFOz3Vik=">https://datatracker.ietf.org/doc/html/rfc1157/#section-4.1.6</a></span></p>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> syslog-ng <<a href="mailto:syslog-ng-bounces@lists.balabit.hu">syslog-ng-bounces@lists.balabit.hu</a>> on behalf of Fabien Wernli <<a href="mailto:wernli@in2p3.fr">wernli@in2p3.fr</a>><br>
<b>Sent:</b> Tuesday, March 22, 2022 8:12<br>
<b>To:</b> Maurya, Shivani <<a href="mailto:shivani.maurya@intel.com">shivani.maurya@intel.com</a>><br>
<b>Cc:</b> Syslog-ng users' and developers' mailing list <<a href="mailto:syslog-ng@lists.balabit.hu">syslog-ng@lists.balabit.hu</a>><br>
<b>Subject:</b> Re: [syslog-ng] Customizing syslog-ng snmp() destination option</span>
</p>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<div>
<div>
<p class="x_MsoNormal" style="margin-bottom:12.0pt">CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.<br>
<br>
<br>
Hi again,<br>
<br>
On Tue, Mar 22, 2022 at 06:09:32AM +0000, Maurya, Shivani wrote:<br>
> But this is how I want an extra field to be added in trap itself before the variable-binding -<br>
><br>
> [<a href="cid:image002.png@01D83DE1.7C82C330">cid:image002.png@01D83DE1.7C82C330</a>]<br>
<br>
As I said, I think you can achieve this using `snmp-obj()`.<br>
Try the following:<br>
<br>
    snmp-obj('.1.3.6.1.6.3.18.1.3.0', 'Ipaddress', "${SOURCEIP}")<br>
<br>
______________________________________________________________________________<br>
Member info: <a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=04%7C01%7CGabor.Nagy%40oneidentity.com%7C574fb68ee07141f2da1308da0c97ba6d%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637836143070345948%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=5A6zt%2FyDfaKksjYe%2FAXv2PR8zrYwJZETZ91gPvPduLw%3D&reserved=0" originalsrc="https://lists.balabit.hu/mailman/listinfo/syslog-ng" shash="HAOVfzeWsCXKUIERN7OZFvzcFypjbFNHhQHL25TNuZJnpWIj98xMHH6IHL/psldvy268N7Hp2fT/KskfHkezmvKS3Fyx71F9nEzlPnPnGLPhWkkRFHdirIn4Dgp3VKX6XHc/u7j30E1GyhSO1sDMDpFGJ3L+KE0XkP5nQGKXMoA=">
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&amp;data=04%7C01%7Cgabor.nagy%40oneidentity.com%7C1341f1fe92104de79ae708da0bd35bee%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637835299655341547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=mJAT2oTdxOtlg%2FviRHWvJfDuGCGeAPABN%2BCqDmuFA9Q%3D&amp;reserved=0</a><br>
Documentation: <a href="https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=04%7C01%7CGabor.Nagy%40oneidentity.com%7C574fb68ee07141f2da1308da0c97ba6d%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637836143070502180%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=LEKiL8bNZSlGnO5n2wpW6EhCNPxhs3GOigyif8Pe%2Be8%3D&reserved=0" originalsrc="http://www.balabit.com/support/documentation/?product=syslog-ng" shash="Nru0bj8K1cDkYsyQs8RUQsbkotK0poigcPnmH0MM3lSALzIrXIWhpbRgN6mMmIDIt+yH12oiQeq/W5R6kFOTkzD4p7+m4LvWmsT6fINQ+qx1ovUxCOpyrXIpCwrjq4XYEUJcmcnocVGzBJmL1hPPHxNtuDnoZAa0oRKviXaBQ6w=">
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&amp;data=04%7C01%7Cgabor.nagy%40oneidentity.com%7C1341f1fe92104de79ae708da0bd35bee%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637835299655341547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=Nojx51D6YkOswnnLzog1ykOV3D39L8cv%2B4NLIRm%2BkNU%3D&amp;reserved=0</a><br>
FAQ: <a href="https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=04%7C01%7CGabor.Nagy%40oneidentity.com%7C574fb68ee07141f2da1308da0c97ba6d%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637836143070502180%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=F6NcWFgmoWvUaLYcRMfmw%2Bkd3PEbWJhdkjNeF%2FQrV9I%3D&reserved=0" originalsrc="http://www.balabit.com/wiki/syslog-ng-faq" shash="DOf9blL39CGd2mZQsOrj52aYVUAZkxp0oYbhZCPVoAWhut1fMIQbJ5GQJ1PqofQxiddrhPIzqTZBQ5Lvk5TDxv31VHI/f0pN1vmuJM0o+Q1xGkGq5jYoROI+YetUG01ayBHRz0OvYqFEo2pugHORgAOomJFtwQMCgOFPo536J1c=">
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&amp;data=04%7C01%7Cgabor.nagy%40oneidentity.com%7C1341f1fe92104de79ae708da0bd35bee%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637835299655341547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=u3FuE5V2S8%2BCWe2k6AupGSQ%2F6gX3j4SMvMDTchwJuOM%3D&amp;reserved=0</a></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>