diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-03-10 01:07:06 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-03-10 01:07:06 +0000 |
commit | e6869816c1a41df038cf2b747b33fe59b0629344 (patch) | |
tree | 31cb6d87062bb0938ef4ca4a84feb9e54b6eb1d2 | |
parent | 530347edf413614d3846ad109fdfc89aa13893e2 (diff) | |
download | pfsense-e6869816c1a41df038cf2b747b33fe59b0629344.zip pfsense-e6869816c1a41df038cf2b747b33fe59b0629344.tar.gz |
Correctly output correct number of records chosen on "pretty" rules mode
-rwxr-xr-x | usr/local/www/diag_logs_filter.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index e84e0f1..f301389 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -48,7 +48,7 @@ function dump_clog($logfile, $tail, $withorig = true) { $sor = isset($config['syslog']['reverse']) ? "-r" : ""; - exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n " . $tail, $logarr); + exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n " . "15000", $logarr); foreach ($logarr as $logent) { $logent = preg_split("/\s+/", $logent, 6); @@ -80,6 +80,8 @@ function conv_clog($logfile, $tail) { $filterlog = array(); + $counter = 0; + foreach ($logarr as $logent) { $dontdisplay = 0; @@ -115,6 +117,9 @@ function conv_clog($logfile, $tail) { if($dontdisplay == 0) $filterlog[] = $flent; + + if($counter > $nentries) + break; } return $filterlog; |