From a333d970495943557bb6d90b04d08c58db8668dc Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 26 Dec 2005 20:06:13 +0000 Subject: Do not display the line if we cannot extract the protocol type --- usr/local/www/diag_logs_filter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr/local/www/diag_logs_filter.php') diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index ee54888..e56e3fc 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -73,6 +73,7 @@ function conv_clog($logfile, $tail = 50) { if($log_split[5] == "") preg_match("/(.*)\s(.*)\spf:.*rule.*\(match\):\s(\w+)\sin\son\s(\w+:)\s([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\s([\<|\>])\s([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}):.*/",$logent,$log_split); + $do_not_display = false; $flent['proto'] = "TCP"; if(stristr($logent, "UDP") == true) $flent['proto'] = "UDP"; @@ -92,6 +93,8 @@ function conv_clog($logfile, $tail = 50) { $flent['proto'] = "CARP"; else if(stristr($logent, "PFSYNC") == true) $flent['proto'] = "PFSYNC"; + else + $do_not_display = true; $flent['time'] = $log_split[1]; $flent['act'] = $log_split[3]; @@ -105,7 +108,7 @@ function conv_clog($logfile, $tail = 50) { $flent['dst'] = $log_split[7]; } - if($flent['src'] == "" or $flent['dst'] == "") { + if($flent['src'] == "" or $flent['dst'] == "" or $do_not_display == true) { /* do not display me! */ } else { $counter++; -- cgit v1.1