Project

General

Profile

« Previous | Next » 

Revision 00aab3df

Added by Scott Ullrich over 20 years ago

Really correctly output correct number of records chosen on "pretty" rules mode

View differences:

usr/local/www/diag_logs_filter.php
67 67
function conv_clog($logfile, $tail) {
68 68
	global $g, $config;
69 69

  
70
	$nentries = $config['syslog']['nentries'];
71
	if (!$nentries)
72
		$nentries = 50;
73

  
70 74
	/* make interface/port table */
71 75
	$iftable = array();
72 76
	$iftable[$config['interfaces']['lan']['if']] = "LAN";
......
76 80

  
77 81
	$sor = isset($config['syslog']['reverse']) ? "-r" : "";
78 82

  
79
	exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
83
	exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n 250000", $logarr);
80 84

  
81 85
	$filterlog = array();
82 86

  
......
115 119

  
116 120
		if($flent['proto'] == "S" or $flent['proto'] == "NBT" or $flent['proto'] == "." or $flent['proto'] == "R" or $flent['proto'] == ">") $dontdisplay = 1;
117 121

  
118
		if($dontdisplay == 0)
122
		if($dontdisplay == 0) {
119 123
			$filterlog[] = $flent;
120 124

  
121
		if($counter > $nentries)
122
			break;
125
			if($counter > $nentries)
126
				return $filterlog;
127

  
128
			$counter++;
129
		}
123 130
	}
124 131

  
125 132
	return $filterlog;

Also available in: Unified diff