You are including the time stamps in the key, so identical events a second apart increment separate counts. or maybe you were showing the overall concept, and leaving the trimming as an exercise for the student?
It looks like gen-vcs11 kernel is a standard component of every line, so I would ignore it. Using split to extract the second and third components, and using those as a key:
my ( $code, $msg ) = ( split, ':', $_)[2,3]; $msgs{$code}{$msg}++;
It becomes even simplar if you only want to preserve the msg component.
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In reply to Re^2: How do I read a log file that contents recurring log messages those are separated by newline characters?
by TomDLux
in thread How do I read a log file that contents recurring log messages those are separated by newline characters?
by WantToBeJediInPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |