diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-14 11:26:52 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-14 11:26:52 -0500 |
commit | 7f094976cf84a356b2f564ad10c7433dbf71c379 (patch) | |
tree | dc769714facc7cf21d4184ff65d4b25eff21b8c8 /src/etc | |
parent | 39609bf9959f77394943f05352d4cab095a8a2c6 (diff) | |
parent | a0fdbd1d0f08e6b92d318ec5d2fe96018d271ba9 (diff) | |
download | pfsense-7f094976cf84a356b2f564ad10c7433dbf71c379.zip pfsense-7f094976cf84a356b2f564ad10c7433dbf71c379.tar.gz |
Merge pull request #2212 from NOYB/Sys_Log_RegEx_Var_Name_Tweak
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/filter_log.inc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/etc/inc/filter_log.inc b/src/etc/inc/filter_log.inc index 71b05b4..e3ca6fe 100644 --- a/src/etc/inc/filter_log.inc +++ b/src/etc/inc/filter_log.inc @@ -113,11 +113,16 @@ function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "", $fil $date_pattern = "\(" . $month_pattern . "\ +" . $day_pattern . "\ +" . $time_pattern . "\)"; - $process_pattern = "\(.*?\)"; - $pid_pattern = "\(.*?\)\(?::\ +\)?\(?:\[[0-9:]*\]\)?:?"; + $host_pattern = "\(.*?\)"; +# $host_pattern = "\([a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]\)"; + + $process_pattern = "\(.*?\)\(?::\ +\)?"; + $pid_pattern = "\(?:\[[0-9:]*\]\)?:?"; + $process_pid_pattern = $process_pattern . $pid_pattern; + $log_message_pattern = "\(.*\)"; - $pattern = "^" . $date_pattern . "\ +" . $process_pattern . "\ +" . $pid_pattern . "\ +" . $log_message_pattern . "$"; + $pattern = "^" . $date_pattern . "\ +" . $host_pattern . "\ +" . $process_pid_pattern . "\ +" . $log_message_pattern . "$"; } else if ($logfile_type == 'tbd') { $pattern = "^\(.*\)$"; @@ -265,11 +270,16 @@ function parse_system_log_line($line) { $date_pattern = "(" . $month_pattern . "\ +" . $day_pattern . "\ +" . $time_pattern . ")"; - $process_pattern = "(.*?)"; - $pid_pattern = "(.*?)(?::\ +)?(?:\[([0-9:]*)\])?:?"; + $host_pattern = "(.*?)"; +# $host_pattern = "([a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])"; + + $process_pattern = "(.*?)(?::\ +)?"; + $pid_pattern = "(?:\[([0-9:]*)\])?:?"; + $process_pid_pattern = $process_pattern . $pid_pattern; + $log_message_pattern = "(.*)"; - $pattern = "/^" . $date_pattern . "\ +" . $process_pattern . "\ +" . $pid_pattern . "\ +" . $log_message_pattern . "$/"; + $pattern = "/^" . $date_pattern . "\ +" . $host_pattern . "\ +" . $process_pid_pattern . "\ +" . $log_message_pattern . "$/"; if (!preg_match($pattern, $line, $log_split)) { return ""; |