Fixed a bug in Syslog and Eventlog summary report which consolidated wrong events

when the source filter was used in the report.
This commit is contained in:
Andre Lorbach 2012-01-09 14:32:23 +01:00
parent cf198caf5a
commit 3a85dd917c
3 changed files with 43 additions and 4 deletions

View File

@ -344,13 +344,48 @@ abstract class LogStream {
// Reset Filters first to make sure we do not add multiple filters!
$this->_filters = null;
// Parse Filters from string
$this->ParseFilters($finalfilters);
// return success
return SUCCESS;
}
/**
* Append filter definition for the current stream.
*
* @param filter object in: filter object
* @return integer Error state
*/
public function AppendFilter($szFilters)
{
OutputDebugMessage("LogStream|AppendFilter: SetFilter combined = '" . $szFilters . "'. ", DEBUG_DEBUG);
// Parse Filters from string
$this->ParseFilters($szFilters);
// return success
return SUCCESS;
}
/**
* Remove filters for a specific Fieldtype
*
* @param filter object in: FieldID
* @return integer Error state
*/
public function RemoveFilters($szFieldID)
{
// Removing Filters for this field!
if ( isset($this->_filters[$szFieldID]) )
unset($this->_filters[$szFieldID]);
// return success
return SUCCESS;
}
/**
* Set the direction the stream should read data.
*

View File

@ -356,7 +356,9 @@ class Report_eventsummary extends Report {
{
// Set custom filters
$this->_streamObj->ResetFilters();
$this->_streamObj->SetFilter( $this->_filterString . " " . $fields[SYSLOG_MESSAGETYPE]['SearchField'] . ":=" . IUT_NT_EventReport . ",=" . IUT_WEVTMONV2 . " " . $fields[SYSLOG_HOST]['SearchField'] . ":=" . $myHost );
$this->_streamObj->SetFilter( $this->_filterString . " " . $fields[SYSLOG_MESSAGETYPE]['SearchField'] . ":=" . IUT_NT_EventReport . ",=" . IUT_WEVTMONV2 );
$this->_streamObj->RemoveFilters( SYSLOG_HOST );
$this->_streamObj->AppendFilter( $fields[SYSLOG_HOST]['SearchField'] . ":=" . $myHost );
// Set Host Item Basics if not set yet
$content["report_consdata"][ $myHost ][SYSLOG_HOST] = $myHost;

View File

@ -353,7 +353,9 @@ class Report_syslogsummary extends Report {
{
// Set custom filters
$this->_streamObj->ResetFilters();
$this->_streamObj->SetFilter( $this->_filterString . " " . $fields[SYSLOG_MESSAGETYPE]['SearchField'] . ":=" . IUT_Syslog . " " . $fields[SYSLOG_HOST]['SearchField'] . ":=" . $myHost );
$this->_streamObj->SetFilter( $this->_filterString . " " . $fields[SYSLOG_MESSAGETYPE]['SearchField'] . ":=" . IUT_Syslog );
$this->_streamObj->RemoveFilters( SYSLOG_HOST );
$this->_streamObj->AppendFilter( $fields[SYSLOG_HOST]['SearchField'] . ":=" . $myHost );
// Set Host Item Basics if not set yet
$content["report_consdata"][ $myHost ][SYSLOG_HOST] = $myHost;