diff options
author | Colin Smith <colin@pfsense.org> | 2005-04-06 01:25:02 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-04-06 01:25:02 +0000 |
commit | f5b10f5970426654fe81dce3fd0088e020540470 (patch) | |
tree | 08dfacfe8965089200a1b767d05213ba64ee1b40 | |
parent | 2abc0e6f0c1c5075b000ebbd598e7eeb416f7705 (diff) | |
download | pfsense-f5b10f5970426654fe81dce3fd0088e020540470.zip pfsense-f5b10f5970426654fe81dce3fd0088e020540470.tar.gz |
Fix multiple grepping.
-rwxr-xr-x | usr/local/www/diag_logs.php | 2 | ||||
-rwxr-xr-x | usr/local/www/guiconfig.inc | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php index e4cc0e7..8692ccc 100755 --- a/usr/local/www/diag_logs.php +++ b/usr/local/www/diag_logs.php @@ -75,7 +75,7 @@ if ($_POST['clear']) { <td colspan="2" class="listtopic"> Last <?=$nentries;?> system log entries</td> </tr> - <?php dump_clog($system_logfile, $nentries, array("racoon", "\"message repeated\""), array(true, true)); ?> + <?php dump_clog($system_logfile, $nentries, array("racoon", "kernel"), array(true, true)); ?> </table> <br><form action="diag_logs.php" method="post"> <input name="clear" type="submit" class="formbtn" value="Clear log"> diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 4108ff9..e73ffa4 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -459,8 +459,9 @@ function dump_clog($logfile, $tail, $grepfor = "", $grepinvert = false, $withori if($grepfor <> "") { $size = count($grepfor); + $i = 0; foreach($grepfor as $agrep) { - if($grepinvert[$size - count($grepfor)] == true) { + if($grepinvert[$i] == true) { if($size > 1) { $grep .= "grep -v {$agrep} | "; } else { @@ -475,13 +476,13 @@ function dump_clog($logfile, $tail, $grepfor = "", $grepinvert = false, $withori } $size--; } + $i++; } exec("/usr/sbin/clog {$logfile} | {$grep} | /usr/bin/tail {$sor} -n {$tail}", $logarr); } else { exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr); } foreach ($logarr as $logent) { - print $logent[0]; $logent = preg_split("/\s+/", $logent, 6); echo "<tr valign=\"top\">\n"; |