mattwortho has asked for the wisdom of the Perl Monks concerning the following question:
@files = glob "*.log"; foreach $file (@files) { next unless $file =~ /planetlab/; print "begin\n"; local($\, $,) = ("\n", " "); while(<>) { if(/([\d:.]+).*?\bReceived.*?\bBT_PIECE.*?\bdata.*?\bPeer: (\w +):\s+(\d+\.\d+\.\d+\.\d+):\s*(\d+)/) { print $3; } } print "end"; print "$file\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Log Parsing
by Corion (Patriarch) on Sep 07, 2007 at 12:16 UTC | |
by mattwortho (Acolyte) on Sep 07, 2007 at 13:02 UTC | |
by mattwortho (Acolyte) on Sep 07, 2007 at 12:28 UTC | |
by mattwortho (Acolyte) on Sep 07, 2007 at 12:37 UTC | |
by mattwortho (Acolyte) on Sep 07, 2007 at 12:40 UTC | |
by Corion (Patriarch) on Sep 07, 2007 at 12:47 UTC | |
by mattwortho (Acolyte) on Sep 07, 2007 at 12:42 UTC | |
by moritz (Cardinal) on Sep 07, 2007 at 12:56 UTC | |
by mattwortho (Acolyte) on Sep 07, 2007 at 13:19 UTC | |
by FunkyMonk (Bishop) on Sep 07, 2007 at 16:18 UTC |