I have Scribe installed with a variety of filters, working great. I would like to have a separate log of DHCP messages available in the Scribe web-ui page, without affecting the dnsmaq.log file itself.
I run diversion, which sets dnsmasq to log directly to /opt/var/log/dnsmasq.log.
Can I create a "source" in syslog-ng.conf using ' source dnsmasq { file("/opt/var/log/dnsmasq.log") }; ' to get the dnsmasq messages to sent to syslog-ng?
Assuming that works, then will the code below put all DHCP messages in one file, and ignore the rest of the dnsmasq messages? Do I need the /dev/null destination, or can I ignore them by just having a filter and not specifying a destination?
Will syslog-ng "watching" /opt/var/log/dnsmasq.log as a "source" cause any issues when diversion needs to rotate the dnsmasq logs?
I run diversion, which sets dnsmasq to log directly to /opt/var/log/dnsmasq.log.
Can I create a "source" in syslog-ng.conf using ' source dnsmasq { file("/opt/var/log/dnsmasq.log") }; ' to get the dnsmasq messages to sent to syslog-ng?
Assuming that works, then will the code below put all DHCP messages in one file, and ignore the rest of the dnsmasq messages? Do I need the /dev/null destination, or can I ignore them by just having a filter and not specifying a destination?
Will syslog-ng "watching" /opt/var/log/dnsmasq.log as a "source" cause any issues when diversion needs to rotate the dnsmasq logs?
Code:
# grab dhcp messages from dnsmasq and log them
destination d_dhcp { file("/opt/var/log/dhcp.log"); };
destination d_oblivion { file("/dev/null"); };
filter f_dnsmasq-dhcp { ( program("dnsmasq-dhcp") ) };
filter f_dnsmasq_other { ( program("dnsmasq" ) ) };
log { source(dnsmasq); filter(f_dhcp); destination(d_dhcp); flags(final); };
log { source(dnsmasq); filter(f_dnsmasq_other); destination(d_oblivion); flags(final); };
#eof