From ff62e170ab673e69e684e3d6ccbc879a04fecea2 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 23 Mar 2010 14:14:22 +0000 Subject: [PATCH] Updated rSyslog plugin git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17030 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../rsyslog/addons/rsyslog/class_rsyslog.inc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc b/gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc index 6462918aa..0f0cf05b6 100644 --- a/gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc +++ b/gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc @@ -194,8 +194,13 @@ class rsyslog extends plugin $prio = "%%"; if($this->selected_priority != "all") $prio = $this->selected_priority; - $filter = "FROM SystemEvents WHERE FromHost like '{$host}' "; - $filter.= "AND Priority like '{$prio}' "; + $filter = "FROM SystemEvents WHERE 1=1 "; + if($host != "%%"){ + $filter.= " AND FromHost like '{$host}' "; + } + if($prio != "%%"){ + $filter.= "AND Priority like '{$prio}' "; + } $filter.= "AND DeviceReportedTime >= '".(date("Y.m.d 00:00:00", strtotime($this->startTime)))."' "; $filter.= "AND DeviceReportedTime <= '".(date("Y.m.d 23:59:59", strtotime($this->stopTime)))."' "; @@ -232,6 +237,11 @@ class rsyslog extends plugin $attrs['Facility']= $this->facility2string($attrs['Facility']); $attrs['Priority']= $this->severity2string($attrs['Priority']); $attrs['SysLogTag']= preg_replace("/:$/", "", $attrs['SysLogTag']); + + foreach($attrs as $key => $val){ + $attrs[$key] = htmlentities($val, ENT_COMPAT, 'UTF-8'); + } + $result['entries'][] = $attrs; } $this->servers[$name]['status'] = "ok"; -- 2.30.2