summaryrefslogtreecommitdiffstats
path: root/etc/inc/filter_log.inc
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2012-10-01 14:36:40 +0200
committerPiBa-NL <pba_2k3@yahoo.com>2012-10-01 14:36:40 +0200
commit90763c7fabf9dbcba50dcb15748c7c6d5dc148ec (patch)
tree795a37d999a8185c3bd2a6be5b14197e48ec51aa /etc/inc/filter_log.inc
parente3449857823529516e986776ae4497280ca6dedd (diff)
downloadpfsense-90763c7fabf9dbcba50dcb15748c7c6d5dc148ec.zip
pfsense-90763c7fabf9dbcba50dcb15748c7c6d5dc148ec.tar.gz
Firewall log, allow filtering by interface.
Diffstat (limited to 'etc/inc/filter_log.inc')
-rw-r--r--etc/inc/filter_log.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc
index d55d332..3e06058 100644
--- a/etc/inc/filter_log.inc
+++ b/etc/inc/filter_log.inc
@@ -37,7 +37,7 @@
require 'config.inc';
/* format filter logs */
-function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "") {
+function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "", $filterinterface = null) {
global $config, $g;
/* Make sure this is a number before using it in a system call */
@@ -63,15 +63,18 @@ function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "") {
$counter = 0;
$logarr = array_reverse(collapse_filter_lines(array_reverse($logarr)));
-
+ $filterinterface = strtoupper($filterinterface);
foreach ($logarr as $logent) {
if($counter >= $nentries)
break;
$flent = parse_filter_line($logent);
- if (($flent != "") && (match_filter_line($flent, $filtertext))) {
- $counter++;
- $filterlog[] = $flent;
+ if (!$filterinterface || ($filterinterface == $flent['interface']))
+ {
+ if (($flent != "") && (match_filter_line($flent, $filtertext))) {
+ $counter++;
+ $filterlog[] = $flent;
+ }
}
}
/* Since the lines are in reverse order, flip them around if needed based on the user's preference */
OpenPOWER on IntegriCloud