--- Syslog.pm.orig 2006-01-05 14:43:44.000000000 +0100 +++ Syslog.pm 2006-12-12 14:43:25.087163300 +0100 @@ -222,12 +222,12 @@ (\S{3})\s+(\d+) # date -- 1, 2 \s (\d+):(\d+):(\d+) # time -- 3, 4, 5 - (?:\s<\w+\.\w+>)? # FreeBSD's verbose-mode + (\s<(\w+)\.(\w+)>)? # FreeBSD's verbose-mode 6,7,8 \s - ([-\w\.\@:]+) # host -- 6 + ([-\w\.\@:]+) # host -- 9 \s+ (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD - (.*) # text -- 7 + (.*) # text -- 10 $/x or do { warn "WARNING: line not in syslog format: $str"; @@ -249,7 +249,7 @@ } } - my ($host, $text) = ($6, $7); + my ($facility, $level, $host, $text) = ($7, $8, $9, $10); # last message repeated ... times if($text =~ /^(?:last message repeated|above message repeats) (\d+) time/) { @@ -286,6 +286,12 @@ warn "WARNING: line not in syslog format: $str"; next line; }; + unless(defined($facility)) { + $facility = $4; + } + unless(defined($level)) { + $level = $5; + } if($self->{arrayref}) { $self->{_last_data}{$host} = [ @@ -303,8 +309,8 @@ program => $1, pid => $2, msgid => $3, - facility => $4, - level => $5, + facility => $facility, + level => $level, text => $6, }; }