mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Extra options for grep_log plugin
+lines -lines around the matched one
This commit is contained in:
parent
19fad8acc6
commit
d7d44d84e8
@ -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";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user