#!/usr/bin/perl
$dir='/home/websphere/WebSphere/AppServer/profiles/AppSrv01/logs/server1';
$file = 'SystemErr.log';
$mon_file="$dir/$file";
print "\$mon_file is $mon_file\n";
@warn_arr = qw/连接已关闭 NullPointException IndexOutOfBound/;
foreach $a (@warn_arr){
open (C,"<","$a.tmp") ;
while (<C>){
$count = $_;
}
print "\$count is $count\n";
$info =`tac $mon_file | grep "$a" | head -1`;
open (A ,"<","$mon_file") || die "$!\n
Perl 打印特定行日志
最新推荐文章于 2021-03-02 13:55:18 发布