Re: [Hampshire] rsyslog query

Top Page

Reply to this message
Author: Leo
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] rsyslog query
On 28/04/12 10:38, Simon Reap wrote:
> On 27/04/2012 23:33, Leo wrote:
>> However the dhcpd one still isn't being working, it is:
>> :msg, contains, "dhcpd:" /var/log/dhcpd.log
>> & ~
>>
>>
>> Chris,
>> I tried your suggestion and that indicates that it's definitely
>> reading the file, but it's still writing all the dhcpd logs to syslog,
>> rather than dhcpd.log
>>
>
> If the lines above come before the line that writes syslog, and the
> messages contains the exact text "dhcpd:", then I can't see why that
> wouldn't work.
>
> Maybe try
>
> :programname,isequal,"dhcpd" /var/log/dhcpd.log
>
> --
> Please post to: Hampshire@???
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --------------------------------------------------------------
>


Aha, I think I've got it! Just found this line in dhcpd.conf:
log-facility local7;

So I changed the rsyslog rule to local7.*, rather than a :msg one and
it's started working. Although I'm now curious: how would I combine the
two, i.e. log to dhcpd.conf if the message is on local7, and if it
contains "dhcpd:"?

Leo

--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------