diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-02-06 01:24:57 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-02-06 01:24:57 +0000 |
commit | b4c3b8a01c4be46d2ca793028797ff335ded9db6 (patch) | |
tree | 268ce95012fb66abf8ad4b11775256754e105872 /usr | |
parent | 2e41791cddddd9cc3739fa32f37fe32a11673f07 (diff) | |
download | pfsense-b4c3b8a01c4be46d2ca793028797ff335ded9db6.zip pfsense-b4c3b8a01c4be46d2ca793028797ff335ded9db6.tar.gz |
Update REGEX to match -v behavior
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/diag_logs_filter.php | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index 39b51b8..1c9caff 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -79,69 +79,54 @@ function conv_clog($logfile, $tail = 50) { break; $log_split = ""; - - /* pf: 6. 272592 rule 218/0(match): block in on fxp0: 72.240.236.119.4503 > 216.135.89.2.6881: S 1163549441:1163549441(0) win 65535 <mss 1432,nop,nop,sackOK> */ - 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}\.[0-9]{1,7})\s([\<|\>])\s([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,7}):.*/",$logent,$log_split); - - 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); - + preg_match("/(.*)\s.*\spf:\s.*\srule\s(.*)\(match\)\:\s(.*)\s\w+\son\s(\w+)\:\s(.*)\s>\s(.*)\:\s.*/", $logent, $log_split); + $logent = strtoupper($logent); $do_not_display = false; - if(stristr($logent, "UDP") == true) + + if(stristr(strtoupper($logent), "UDP") == true) $flent['proto'] = "UDP"; - else if(stristr($logent, "TCP") == true) + else if(stristr(strtoupper($logent), "TCP") == true) $flent['proto'] = "TCP"; - else if(stristr($logent, "ICMP") == true) + else if(stristr(strtoupper($logent), "ICMP") == true) $flent['proto'] = "ICMP"; - else if(stristr($logent, "HSRP") == true) + else if(stristr(strtoupper($logent), "HSRP") == true) $flent['proto'] = "HSRP"; - else if(stristr($logent, "ESP") == true) + else if(stristr(strtoupper($logent), "ESP") == true) $flent['proto'] = "ESP"; - else if(stristr($logent, "AH") == true) + else if(stristr(strtoupper($logent), "AH") == true) $flent['proto'] = "AH"; - else if(stristr($logent, "GRE") == true) + else if(stristr(strtoupper($logent), "GRE") == true) $flent['proto'] = "GRE"; - else if(stristr($logent, "IGMP") == true) + else if(stristr(strtoupper($logent), "IGMP") == true) $flent['proto'] = "IGMP"; - else if(stristr($logent, "CARP") == true) + else if(stristr(strtoupper($logent), "CARP") == true) $flent['proto'] = "CARP"; - else if(stristr($logent, "PFSYNC") == true) + else if(stristr(strtoupper($logent), "PFSYNC") == true) $flent['proto'] = "PFSYNC"; else $do_not_display = true; - $log_split[5] = str_replace(":","",$log_split[5]); - $flent['time'] = $log_split[1]; - $flent['act'] = $log_split[4]; + $flent['act'] = $log_split[3]; - $friendly_int = convert_real_interface_to_friendly_interface_name($log_split[5]); + $friendly_int = convert_real_interface_to_friendly_interface_name($log_split[4]); $flent['interface'] = strtoupper($friendly_int); if($config['interfaces'][$friendly_int]['descr'] <> "") $flent['interface'] = "{$config['interfaces'][$friendly_int]['descr']}"; - if($flent['proto'] == "TCP" or $flent['proto'] == "UDP") { - $flent['src'] = convert_port_period_to_colon($log_split[6]); - $flent['dst'] = convert_port_period_to_colon($log_split[8]); - } else { - $flent['src'] = $log_split[6]; - $flent['dst'] = $log_split[8]; - } + $flent['src'] = convert_port_period_to_colon($log_split[5]); + $flent['dst'] = convert_port_period_to_colon($log_split[6]); - $tmp = split("/", $log_split[3]); + $tmp = split("/", $log_split[2]); $flent['rulenum'] = $tmp[0]; - if($flent['src'] == "" or $flent['dst'] == "" or $do_not_display == true) { - /* do not display me! */ - } else { - $counter++; - $filterlog[] = $flent; - } + $counter++; + $filterlog[] = $flent; } @@ -185,6 +170,7 @@ include("head.inc"); $tab_array[] = array("IPSEC VPN", false, "diag_logs_ipsec.php"); $tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php"); $tab_array[] = array("Load Balance", false, "diag_logs_slbd.php"); + $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php"); $tab_array[] = array("Settings", false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> |