@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"; }
In reply to Log Parsing by mattwortho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |