提交 4dc18e0b authored 作者: Michael S Collins's avatar Michael S Collins

Initial commit of access_log.pl script which makes reading log files easier for…

Initial commit of access_log.pl script which makes reading log files easier for those using screen readers
上级 386f9f63
#!/usr/bin/perl
use strict;
use warnings;
#
# 2013-08-07 18:05:04.927252 [NOTICE] mod_logfile.c:213 New log started.
#
my $logfile = $ARGV[0];
open(FILEIN,'<',$logfile) or die "$! - $logfile\n";
while(<FILEIN>) {
chomp;
if ( m/(.*?\] [^:]+:\d+\s)(.*)/ ) {
#print "Line: $_\n";
#print "Part 1: $1\n";
#print "Part 2: $2\n\n";
print "$2 $1\n";
} else {
print "$_\n";
}
}
close(FILEIN)
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论