<p dir="ltr"><br>
On Feb 6, 2014 3:42 PM, &quot;C. L. Martinez&quot; &lt;<a href="mailto:carlopmart@gmail.com">carlopmart@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi all,<br>
&gt;<br>
&gt;  Is it possible to add multiple rewrite conditions in syslog-ng 3.4.x like this:<br>
&gt;<br>
&gt; rewrite r_rewrite_set{<br>
&gt;               set(&quot;myhost1&quot;, value(&quot;HOST&quot;)<br>
&gt; condition(program(&quot;myapplication1&quot;)));<br>
&gt;               set(&quot;myhost2&quot;, value(&quot;HOST&quot;)<br>
&gt; condition(program(&quot;myapplication2&quot;)));<br>
&gt;               set(&quot;myhost3&quot;, value(&quot;HOST&quot;)<br>
&gt; condition(program(&quot;myapplication3&quot;)));<br>
&gt;               set(&quot;myhost4&quot;, value(&quot;HOST&quot;)<br>
&gt; condition(program(&quot;myapplication4&quot;)));<br>
&gt; };<br>
&gt;</p>
<p dir="ltr">Well, this would sequentially evaluate the filters, and then apply the rewrite rule which matches.</p>
<p dir="ltr">If this is the only thing you want to change based on the program filter, then it should be ok.</p>
<p dir="ltr">If you have or will have more rewrites using the same condition, I&#39;d use the junction syntax instead.</p>
<p dir="ltr">Junction {<br>
   Log {<br>
      Filter { program(...); };<br>
      Rewrite {}<br>
      Flags(final);<br>
   }<br>
   Log {};<br>
   ...<br>
}</p>
<p dir="ltr">This should break out at the first match, instead of trying to match all.</p>
<p dir="ltr">What&#39;s more this whole junction block can be created as a rewrite rule, and then referenced in multiple logpaths.</p>
<p dir="ltr">&gt; ??<br>
&gt;<br>
&gt;  Is this a good option or maybe a performance penalty??<br>
&gt;<br>
&gt; Thanks.<br>
&gt; ______________________________________________________________________________<br>
&gt; Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
&gt; Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
&gt; FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
&gt;<br>
</p>