projects
/
zfs-ubuntu
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
20a696f
)
Added date filter capability when parsing snapshot total logs.
author
Alan J. Pippin
<ajp@pippins.net>
Fri, 14 Mar 2008 19:34:06 +0000
(13:34 -0600)
committer
Alan J. Pippin
<ajp@pippins.net>
Fri, 14 Mar 2008 19:34:06 +0000
(13:34 -0600)
zfs-log-parser
patch
|
blob
|
history
diff --git
a/zfs-log-parser
b/zfs-log-parser
index f3619dbe912fc5caf4e13184119905a8304a37c8..c277e142bf63cc094e0a6657dfc22831d8be80da 100755
(executable)
--- a/
zfs-log-parser
+++ b/
zfs-log-parser
@@
-91,10
+91,13
@@
sub parse_snapshot_totals_logfile {
%totals=();
$in_totals=0;
$maxlen=0;
%totals=();
$in_totals=0;
$maxlen=0;
+ $found_startdate=0;
$header="";
while(<FILE>) {
$line = $_;
if($line =~ /logfile turned over/) { next; }
$header="";
while(<FILE>) {
$line = $_;
if($line =~ /logfile turned over/) { next; }
+ if(($in_totals == 0) && ("$startdate" ne "") && ($line !~ /$startdate/) && ($found_startdate==0)) { next; }
+ if(($in_totals == 0) && ("$startdate" ne "") && ($line =~ /$startdate/) && ($found_startdate==0)) { $found_startdate=1; }
if(($in_totals == 0) && ($line =~ /(\S+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+)/)) {
$dayname=$1; $month=$2; $daynum=$3; $hour=$4; $minute=$5; $sec=$6; $year=$8;
$in_totals = 1;
if(($in_totals == 0) && ($line =~ /(\S+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+)/)) {
$dayname=$1; $month=$2; $daynum=$3; $hour=$4; $minute=$5; $sec=$6; $year=$8;
$in_totals = 1;