Thanks for the reply!<div><br></div><div>I started it in Foreground and sent only one log from my mac.. this is the result. And at the bottom i pasted my conf which is very basic and short as i am testing this.</div><div><br>
</div><div><div>Incoming log entry; line=&#39;&lt;190&gt;Nov 20 12:22:20 Gandalf brahama[90151]: test mymac\x0a&#39;</div><div>Filter rule evaluation begins; rule=&#39;f_casper&#39;, location=&#39;/usr/local/etc/syslog-ng.conf:58:18&#39;</div>
<div>Filter node evaluation result; result=&#39;not-match&#39;</div><div>Filter rule evaluation result; result=&#39;not-match&#39;, rule=&#39;f_casper&#39;, location=&#39;/usr/local/etc/syslog-ng.conf:58:18&#39;</div><div>
Filter rule evaluation begins; rule=&#39;f_my_mac&#39;, location=&#39;/usr/local/etc/syslog-ng.conf:54:18&#39;</div><div>Filter node evaluation result; result=&#39;match&#39;</div><div>Filter rule evaluation result; result=&#39;match&#39;, rule=&#39;f_my_mac&#39;, location=&#39;/usr/local/etc/syslog-ng.conf:54:18&#39;</div>
<div>Initializing destination file writer; template=&#39;/var/log/mymac&#39;, filename=&#39;/var/log/mymac&#39;</div><div>Initializing destination file writer; template=&#39;/var/log/messages&#39;, filename=&#39;/var/log/messages&#39;</div>
</div><div><br></div><div><div>Incoming log entry; line=&#39;&lt;142&gt;Nov 20 12:44:49 Gandalf brahama[90207]: test mymac\x0a&#39;</div><div>Filter rule evaluation begins; rule=&#39;f_my_mac&#39;, location=&#39;/usr/local/etc/syslog-ng.conf:54:18&#39;</div>
<div>Filter node evaluation result; result=&#39;match&#39;</div><div>Filter rule evaluation result; result=&#39;match&#39;, rule=&#39;f_my_mac&#39;, location=&#39;/usr/local/etc/syslog-ng.conf:54:18&#39;</div></div><div><br>
</div><div><div>syslog-ng shutting down; version=&#39;3.4.0alpha3&#39;</div><div>Closing log transport fd; fd=&#39;7&#39;</div><div>Closing log transport fd; fd=&#39;20&#39;</div><div>Closing log transport fd; fd=&#39;21&#39;</div>
<div>Running application hooks; hook=&#39;4&#39;</div></div><div><br></div><div><br></div><div>------------</div><div><br></div><div>And this is my configuration. the entire file</div><div><br></div><div><div>@version: 3.4</div>
<div>@include &quot;scl.conf&quot;</div><div><br></div><div><br></div><div>options {</div><div><span class="" style="white-space:pre">        </span>keep_hostname(yes);</div><div><span class="" style="white-space:pre">        </span>normalize_hostnames(yes);</div>
<div><span class="" style="white-space:pre">        </span>threaded(yes);</div><div><span class="" style="white-space:pre">        </span>ts_format(iso);</div><div><span class="" style="white-space:pre">        </span>use_fqdn(yes);</div><div>
<span class="" style="white-space:pre">        </span></div><div>};</div><div><br></div><div><br></div><div><br></div><div>source s_local {</div><div><span class="" style="white-space:pre">        </span>system();</div><div><span class="" style="white-space:pre">        </span>internal();</div>
<div>};</div><div><br></div><div>source s_network {</div><div><span class="" style="white-space:pre">        </span>udp(so_rcvbuf(1048576));</div><div>};</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br>
</div><div>destination d_my_mac {</div><div><span class="" style="white-space:pre">        </span>file(&quot;/var/log/mymac&quot;);</div><div>};</div><div><br></div><div>destination d_casper {</div><div><span class="" style="white-space:pre">        </span>file(&quot;/var/log/$HOST&quot;);</div>
<div>};</div><div><br></div><div><br></div><div><br></div><div>filter f_my_mac {</div><div><span class="" style="white-space:pre">        </span>netmask(<a href="http://10.24.18.0/255.255.255.0">10.24.18.0/255.255.255.0</a>);</div>
<div>};</div><div><br></div><div>filter f_casper {</div><div><span class="" style="white-space:pre">        </span>netmask(<a href="http://10.24.150.192/255.255.255.255">10.24.150.192/255.255.255.255</a>);</div><div>};</div><div>
<br></div><div><br></div><div>log {</div><div><span class="" style="white-space:pre">        </span>source(s_network);</div><div><span class="" style="white-space:pre">        </span>filter(f_my_mac);</div><div><span class="" style="white-space:pre">        </span>destination(d_my_mac);</div>
<div><span class="" style="white-space:pre">        </span>flags(final);</div><div>};</div><div><br></div><div>destination d_local {</div><div><span class="" style="white-space:pre">        </span>file(&quot;/var/log/messages&quot;);</div>
<div>};</div><div>log {</div><div><span class="" style="white-space:pre">        </span>source(s_network);</div><div><span class="" style="white-space:pre">        </span>destination(d_local);</div><div>};</div></div><div><br></div><div>
-------------------------------------------------</div><div><br></div><div>Still seeing the log on both files messages and mymac :S</div><div><br></div><div>Thanks!</div><div class="gmail_extra"><br><br><div class="gmail_quote">
2012/11/20 Balazs Scheidler <span dir="ltr">&lt;<a href="mailto:bazsi77@gmail.com" target="_blank">bazsi77@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>

    
    
    
<div>
<p>hi,
<br>
<br>if you reference a source from two log statements both will get a copy of the same message. in the 2nd statement you request to send messages to d_local without filtering. that includes your ip too.
<br>
<br>ahh, i see you are using flags(final), that should do the trick if the message is received on the same source (e.g. s_network). are you sure this is the case?
<br>
<br>also, you can start syslog-ng in the foreground, enabling debug messages which should help you to narrow the problem further down.
<br>
<br># syslog-ng -Fedv
<br></p><div><div class="h5">
<br>
<br>----- Original message -----
<br>&gt; Hi guys,
<br>&gt; 
<br>&gt; Just new, and created the following conf for testing purposes. The
<br>&gt; problem is that i get the logs in both destinations despite the filter.
<br>&gt; 
<br>&gt; @version: 3.4
<br>&gt; @include &quot;scl.conf&quot;
<br>&gt; 
<br>&gt; options {
<br>&gt;                 keep_hostname(yes);
<br>&gt;                 normalize_hostnames(yes);
<br>&gt;                 threaded(yes);
<br>&gt;                 ts_format(iso); # Adds TZ
<br>&gt;                 #use_fqdn(yes);
<br>&gt;                 use_dns(no);
<br>&gt; };
<br>&gt; 
<br>&gt; source s_local {
<br>&gt;                 system();
<br>&gt;                 internal();
<br>&gt; };
<br>&gt; 
<br>&gt; source s_network {
<br>&gt;                 udp();
<br>&gt; };
<br>&gt; 
<br>&gt; destination d_local {
<br>&gt;                 file(&quot;/var/log/messages&quot;);
<br>&gt; };
<br>&gt; 
<br>&gt; destination d_my_mac {
<br>&gt;                 file(&quot;/var/log/mymac&quot;);
<br>&gt; };
<br>&gt; 
<br>&gt; filter f_my_mac {
<br>&gt;                 netmask(<a href="http://10.24.18.2/255.255.255.255" target="_blank">10.24.18.2/255.255.255.255</a>);
<br>&gt; };
<br>&gt; 
<br>&gt; log {
<br>&gt;                 source(s_network);
<br>&gt;                 filter(f_my_mac);
<br>&gt;                 destination(d_my_mac);
<br>&gt;                 flags(final);
<br>&gt; };
<br>&gt; 
<br>&gt; log {
<br>&gt;                 source(s_local);
<br>&gt;                 # uncomment this line to open port 514 to receive messages
<br>&gt;                 source(s_network);
<br>&gt;                 #destination(d_central_udp);
<br>&gt;                 destination(d_local);
<br>&gt; };
<br>&gt; 
<br>&gt; 
<br>&gt; as netmask i also tried cidr /24 and same thing. The problem is that i
<br>&gt; get the logs in both destinations. I only want to have them in my_mac
<br>&gt; 
<br>&gt; Thanks!
<br><br></div></div><p></p>
</div>

</blockquote></div><br></div>