<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 16, 2020, 06:04 Dan Egli <dan@newideatest.site> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Help me understand this, please? I have ISC dhcpd configured to log to <br>
syslog.local7 (since I don't see an option to force it into it's own log <br>
file).</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Hmm syslog.local7 doesn't seem to be a facility.severity pair.</div><div dir="auto"><br></div><div dir="auto">Both syslog and localX are facility codes, so either syslog or localX.</div><div dir="auto"><br></div><div dir="auto">Syslog is normally reserved for the syslog subsystem, so I wouldn't use that for dhcpd.</div><div dir="auto"><br></div><div dir="auto">Also, logging and filtering based on facility codes alone is not really flexible, as facility codes were not kept up with changes of the underlying system. There are dedicated codes for legacy stuff like "news" which people rarely use, but lack newer stuff like kafka or docker.</div><div dir="auto"><br></div><div dir="auto">So in most cases, I see people use the PROGRAM field, or even the IP address of devices to classify log messages.</div><div dir="auto"><br></div><div dir="auto">Still, in your use case the current set of facility codes could be just fine.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So I went into my syslog-ng file and created two filters, just <br>
like on the example page of <a href="http://syslog-ng.com" rel="noreferrer noreferrer" target="_blank">syslog-ng.com</a>:<br>
<br>
filter dhcpmsgs { facility(23) );<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This would filter on facility code 23, each facility is mapped to a numeric code, I can't remember what is 23, but you can check rfc3164 for the exact assignment. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
filter non_dhcp { NOT filter(dhcpmsgs) );<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Negation should be lower case, e.g. "not"</div><div dir="auto">The closing paren should be a closing brace (e.g. "}")</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I quoted almost directly from the example page on <a href="http://syslog-ng.com" rel="noreferrer noreferrer" target="_blank">syslog-ng.com</a>, but I <br>
keep getting this error when I reload syslog-ng's config:<br>
Error parsing filter expression, filter plugin NOT not found OR you may <br>
not used double quotes in your filter expression in <br>
/etc/syslog-ng/syslog-ng.conf:25:18-25:21:<br>
<br>
What did I do wrong? Here's the lines I modified from the syslog-ng page:<br>
filter demo_filter { host("example") and match("deny" value("MESSAGE")) };<br>
filter inverted_demo_filter { NOT filter(demo_filter) }<br>
<br>
You can see the page at: <br>
<a href="https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/53" rel="noreferrer noreferrer" target="_blank">https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/53</a> <br>
<br>
<br>
-- <br>
Dan Egli<br>
From my Test Server<br>
<br>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote></div></div></div>