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 71d05f1fa5
commit fc97600d4a
1 changed files with 1 additions and 8 deletions

View File

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