diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-11 22:33:56 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-11 22:33:56 +0000 |
commit | 15c37284ba9ef438c5bc0c9216aece451100dabf (patch) | |
tree | e83babc1fb11735023517adb4654d2250f2ffcce /usr/local/www/guiconfig.inc | |
parent | ecc9977a85f6c8a8843e3754291bed2bc725c285 (diff) | |
download | pfsense-15c37284ba9ef438c5bc0c9216aece451100dabf.zip pfsense-15c37284ba9ef438c5bc0c9216aece451100dabf.tar.gz |
Don't remove preg_grep just yet.
Diffstat (limited to 'usr/local/www/guiconfig.inc')
-rwxr-xr-x | usr/local/www/guiconfig.inc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 80ae2bb..3c8d5f3 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -458,10 +458,22 @@ function update_changedesc($update) { $changecount++; } -function dump_clog($logfile, $tail, $withorig = true) { +function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") { global $g, $config; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr); + if($grepfor <> "") { + $i = 0; + foreach($grepfor as $agrep) { + $regexp = "/" . $agrep . "/i"; + if($grepinvert[$i] == true) { + $logarr = preg_grep($regexp, $logarr, PREG_GREP_INVERT); + } else { + $logarr = preg_grep($regexp, $logarr); + } + $i++; + } + } foreach ($logarr as $logent) { $logent = preg_split("/\s+/", $logent, 6); echo "<tr valign=\"top\">\n"; |