Extra options for grep_log plugin

+lines -lines around the matched one
This commit is contained in:
fbsanchez 2016-07-29 13:07:48 +02:00
parent 19fad8acc6
commit d7d44d84e8
1 changed files with 1 additions and 8 deletions

View File

@ -204,24 +204,17 @@ sub parse_log (;$$) {
# Push upper lines # Push upper lines
for (my $i = ($curr_line-$up_lines); $i<=$curr_line; $i++){ for (my $i = ($curr_line-$up_lines); $i<=$curr_line; $i++){
if (defined ($lines[$i])) { if (defined ($lines[$i])) {
print "metiendo (up): [" . $lines[$i] . "] $i\n";
push (@data, $lines[$i]); push (@data, $lines[$i]);
} }
else{
print "up: linea no definida $i\n";
}
} }
} }
if (defined($bot_lines)){ if (defined($bot_lines)){
# Push bottom lines # Push bottom lines
for (my $i = ($curr_line+$flag); $i<=($curr_line+$bot_lines); $i++){ for (my $i = ($curr_line+$flag); $i<=($curr_line+$bot_lines); $i++){
if (defined ($lines[$i])) { if (defined ($lines[$i])) {
print "metiendo(bot): [" . $lines[$i] . "] $i\n";
push (@data, $lines[$i]); push (@data, $lines[$i]);
} }
else{
print "up: linea no definida $i\n";
}
} }
} }
} }