Skynet

---------- ---------- 我的新 blog : liukaiyi.cublog.cn ---------- ----------

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  112 Posts :: 1 Stories :: 49 Comments :: 0 Trackbacks


普通的 log4j 日志 ;
当然 特殊要求 特殊处理 。
#!/bin/perl
open(FILES,"/data/apps/schedule/tomcat/logs/app/app.log.2009-02-17");
while (<FILES>) {
    
next if !/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s+ERROR\s+/;
    
if($_=~/(.*-){3}(.*?):(.*)$/g){
        
$error{$2}++ ;
    }
elsif($_=~/(.*-){3}(.*)/g ){
        
$error{$2}++ ;
    } 
    。。。。。
    }   
print "$_: $error{$_}\n" for(keys %error);

 java.net.SocketTimeoutException: 4
 test1 illegal!: 4
 cd illegal!: 4
 test2 illegal!: 4
 MusicAlbum not exists: 5
 Not Found Any File: 14
 java.net.ConnectException: 3
 Album not exists: 2
 。。。




整理 www.blogjava.net/Good-Game
posted on 2009-02-17 15:50 刘凯毅 阅读(1541) 评论(0)  编辑  收藏 所属分类: perl

只有注册用户登录后才能发表评论。


网站导航: