Re: Bug: "--hostformat split" and hostnames with dashes

Orion Poplawski <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
On 10/31/2013 12:03 PM, Sean Alexandre wrote:
> ==== Debian package: logwatch
> ==== Version: 7.4.0+svn20120502rev103-1
>
> ==== Problem:
>
> Hostnames with dashes in them cause "--hostformat split" to report on
> log messages for the wrong host. For example, the report for moose gets both
> of these messages instead of just the first.
>
> Oct 30 12:29:14 moose sshd[24380]: Accepted publickey for frank from 95.111.111.11 port 22 ssh2
> Oct 30 13:06:06 moose-web sshd[8049]: Accepted publickey for frank from 95.111.111.11 port 22 ssh2
>
> ==== Fix:
>
> The pattern that the onlyhost script uses to match against hostname uses \b:
> if ($line =~ m/^... .. ..:..:.. $hostname\b/io) {
>
> Instead it should use \s:
> if ($line =~ m/^... .. ..:..:.. $hostname\s/io) {
>


Thanks.  Checked in.

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       [email protected]
Boulder, CO 80301                   http://www.nwra.com

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.