summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-10 01:14:10 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-10 01:14:10 +0000
commit00aab3df527055ecf90f14e2a4b99b391e9f2b37 (patch)
tree5f337a2c492ea52166c40b51ee28908ee622a0d5 /usr
parente6869816c1a41df038cf2b747b33fe59b0629344 (diff)
downloadpfsense-00aab3df527055ecf90f14e2a4b99b391e9f2b37.zip
pfsense-00aab3df527055ecf90f14e2a4b99b391e9f2b37.tar.gz
Really correctly output correct number of records chosen on "pretty" rules mode
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_logs_filter.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index f301389..6e463e7 100755
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -67,6 +67,10 @@ function dump_clog($logfile, $tail, $withorig = true) {
function conv_clog($logfile, $tail) {
global $g, $config;
+ $nentries = $config['syslog']['nentries'];
+ if (!$nentries)
+ $nentries = 50;
+
/* make interface/port table */
$iftable = array();
$iftable[$config['interfaces']['lan']['if']] = "LAN";
@@ -76,7 +80,7 @@ function conv_clog($logfile, $tail) {
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
- exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
+ exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n 250000", $logarr);
$filterlog = array();
@@ -115,11 +119,14 @@ function conv_clog($logfile, $tail) {
if($flent['proto'] == "S" or $flent['proto'] == "NBT" or $flent['proto'] == "." or $flent['proto'] == "R" or $flent['proto'] == ">") $dontdisplay = 1;
- if($dontdisplay == 0)
+ if($dontdisplay == 0) {
$filterlog[] = $flent;
- if($counter > $nentries)
- break;
+ if($counter > $nentries)
+ return $filterlog;
+
+ $counter++;
+ }
}
return $filterlog;
OpenPOWER on IntegriCloud