<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Стандартный HTML Знак";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTML
{mso-style-name:"Стандартный HTML Знак";
mso-style-priority:99;
mso-style-link:"Стандартный HTML";
font-family:"Courier New";
mso-fareast-language:RU;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle20
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="RU" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:RU">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:RU"><o:p> </o:p></span></p>
<pre><span lang="EN-US" style="color:black">I'm new to syslog-ng, and I'm having some trouble. <o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">I want to use syslog-ng to aggregate similar events from our firewalls. I use the grouping-by parser to create an aggregated event, but I have a question, how do I get only aggregated events on the output without source ones?<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">My configuration:<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">parser p_patterndb {<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> db-parser(file("/etc/syslog-ng/conf.d/forti.xml"));<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> };<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">log {<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> source {<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> file("/tmp/in.log" flags(no-parse));<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> };<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> parser {<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> kv_parser (prefix("forti."));<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> grouping-by(<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> key("${forti.devname}${forti.srcip}${forti.dstip}${forti.dstport}")<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> scope("process")<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> timeout(15)<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> aggregate(<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> value("MESSAGE" "aggegated devname=${forti.devname} srcip=${forti.srcip} dstip=${forti.dstip} dstport=${forti.dstport} count=$(context-length)")<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> inherit-mode("context")<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> )<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> );<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> };<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> destination {<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> file("tmp/out.log");<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> };<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"> };<o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:RU"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:RU">My current output:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Jun 8 08:42:27 centos7-1 <15>Jun 10 16:10:02 fw01 fw: logver=56 devname="fw01" devid=" " vd="" date=2019-06-04 time=15:53:34 logid="0000000013" type="traffic" subtype="forward" level="notice" eventtime=1559652814 srcip=172.26.104.3
srcport=62444 srcintf="ae1.2051" srcintfrole="lan" dstip=172.16.104.219 dstport=9092 dstintf="ae0.2099" dstintfrole="lan" sessionid=3465151973 proto=6 action="deny" policyid=0 policytype="policy" dstcountry="Reserved" srccountry="Reserved" trandisp="noop"
duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned" crscore=30 craction=131072 crlevel="high"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Jun 8 08:42:27 centos7-1 <15>Jun 10 16:10:02 fw01 fw: logver=56 devname="-fw01" devid="" vd=" " date=2019-06-04 time=15:53:34 logid="0000000013" type="traffic" subtype="forward" level="notice" eventtime=1559652814 srcip=172.26.104.3
srcport=62444 srcintf="ae1.2051" srcintfrole="lan" dstip=172.16.104.219 dstport=9092 dstintf="ae0.2099" dstintfrole="lan" sessionid=3465151973 proto=6 action="deny" policyid=0 policytype="policy" dstcountry="Reserved" srccountry="Reserved" trandisp="noop"
duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 appcat="unscanned" crscore=30 craction=131072 crlevel="high"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">crscore=30 craction=131072 crlevel="high"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Jun 8 08:42:28 centos7-1 aggegated devname=fw01 srcip=172.26.104.3 dstip=172.16.104.219 dstport=9092 count=3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">What I want:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Jun 8 08:42:28 centos7-1 aggegated devname=fw01 srcip=172.26.104.3 dstip=172.16.104.219 dstport=9092 count=3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any guidance would be very much appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Maxim Gazin | Senior security engineer | Rostelecom<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>