mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
Added changes to other logstream classed needed due the changes in syslog report
This commit is contained in:
parent
b488be53a1
commit
d165136827
@ -92,6 +92,14 @@ class LogStreamDisk extends LogStream {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to clear the current querystring!
|
||||
*/
|
||||
public function ResetFilters()
|
||||
{
|
||||
// nothing todo in this logstream
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the file.
|
||||
*
|
||||
@ -752,7 +760,7 @@ class LogStreamDisk extends LogStream {
|
||||
*
|
||||
* @return integer Error stat
|
||||
*/
|
||||
public function ConsolidateDataByField($szConsFieldId, $nRecordLimit, $szSortFieldId, $nSortingOrder, $aIncludeCustomFields = null, $bIncludeLogStreamFields = false)
|
||||
public function ConsolidateDataByField($szConsFieldId, $nRecordLimit, $szSortFieldId, $nSortingOrder, $aIncludeCustomFields = null, $bIncludeLogStreamFields = false, $bIncludeMinMaxDateFields = false)
|
||||
{
|
||||
global $content, $fields;
|
||||
|
||||
@ -790,7 +798,10 @@ class LogStreamDisk extends LogStream {
|
||||
$myFieldData = $content['LN_STATS_OTHERS'];
|
||||
|
||||
if ( isset($aResult[ $myFieldData ]) )
|
||||
{
|
||||
$aResult[ $myFieldData ]['ItemCount']++;
|
||||
$aResult[ $myFieldData ]['LastOccurrence_Date'] = $logArray[SYSLOG_DATE];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Initialize entry if we haven't exceeded the RecordLImit yet!
|
||||
@ -811,6 +822,9 @@ class LogStreamDisk extends LogStream {
|
||||
$aResult[ $myFieldData ][$szSortFieldId] = $logArray[$szSortFieldId];
|
||||
|
||||
$aResult[ $myFieldData ]['ItemCount'] = 1;
|
||||
|
||||
$aResult[ $myFieldData ]['FirstOccurrence_Date'] = $logArray[SYSLOG_DATE];
|
||||
$aResult[ $myFieldData ]['LastOccurrence_Date'] = $logArray[SYSLOG_DATE];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -118,6 +118,15 @@ class LogStreamPDO extends LogStream {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to clear the current querystring!
|
||||
*/
|
||||
public function ResetFilters()
|
||||
{
|
||||
// Clear _SQLwhereClause variable!
|
||||
$this->_SQLwhereClause = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the database connection.
|
||||
*
|
||||
@ -864,7 +873,7 @@ class LogStreamPDO extends LogStream {
|
||||
*
|
||||
* @return integer Error stat
|
||||
*/
|
||||
public function ConsolidateDataByField($szConsFieldId, $nRecordLimit, $szSortFieldId, $nSortingOrder, $aIncludeCustomFields = null, $bIncludeLogStreamFields = false)
|
||||
public function ConsolidateDataByField($szConsFieldId, $nRecordLimit, $szSortFieldId, $nSortingOrder, $aIncludeCustomFields = null, $bIncludeLogStreamFields = false, $bIncludeMinMaxDateFields = false)
|
||||
{
|
||||
global $content, $dbmapping, $fields;;
|
||||
|
||||
@ -914,6 +923,13 @@ class LogStreamPDO extends LogStream {
|
||||
else // Only Include ConsolidateField
|
||||
$myDBQueryFields = $myDBConsFieldName . ", ";
|
||||
|
||||
// Add Min and Max fields for DATE if desired
|
||||
if ( $bIncludeMinMaxDateFields )
|
||||
{
|
||||
$myDBQueryFields .= "Min(" . $dbmapping[$szTableType]['DBMAPPINGS'][SYSLOG_DATE] . ") as FirstOccurrence_Date, ";
|
||||
$myDBQueryFields .= "Max(" . $dbmapping[$szTableType]['DBMAPPINGS'][SYSLOG_DATE] . ") as LastOccurrence_Date, ";
|
||||
}
|
||||
|
||||
if ( $szConsFieldId == $szSortFieldId )
|
||||
$myDBSortedFieldName = "ItemCount";
|
||||
else
|
||||
@ -960,6 +976,9 @@ class LogStreamPDO extends LogStream {
|
||||
" ORDER BY " . $myDBSortedFieldName . " " . $szSortingOrder .
|
||||
$szLimitSql ;
|
||||
|
||||
// Output Debug Informations
|
||||
OutputDebugMessage("LogStreamPDO|ConsolidateDataByField: Running Created SQL Query:<br>" . $szSql, DEBUG_DEBUG);
|
||||
|
||||
// Perform Database Query
|
||||
$this->_myDBQuery = $this->_dbhandle->query($szSql);
|
||||
if ( !$this->_myDBQuery )
|
||||
@ -984,10 +1003,14 @@ class LogStreamPDO extends LogStream {
|
||||
|
||||
foreach ( $myRow as $myFieldName => $myFieldValue )
|
||||
{
|
||||
$myFieldID = $this->GetFieldIDbyDatabaseMapping($szTableType, $myFieldName);
|
||||
$aNewRow[ $myFieldID ] = $myFieldValue;
|
||||
/*
|
||||
if ( $myFieldName == $dbmapping[$szTableType]['DBMAPPINGS'][$szConsFieldId] )
|
||||
$aNewRow[$szConsFieldId] = $myFieldValue;
|
||||
else
|
||||
$aNewRow[$myFieldName] = $myFieldValue;
|
||||
*/
|
||||
}
|
||||
|
||||
// Add new row to result
|
||||
|
@ -326,12 +326,7 @@ class Report_syslogsummary extends Report {
|
||||
$myConsData[SYSLOG_FACILITY] = SYSLOG_LOCAL0; // Set default in this case
|
||||
if (!isset( $content['filter_severity_list'][$myConsData[SYSLOG_SEVERITY]] ))
|
||||
$myConsData[SYSLOG_SEVERITY] = SYSLOG_NOTICE; // Set default in this case
|
||||
|
||||
// Set Counter and First/Last Event date
|
||||
$myConsData['FirstOccurrence_Date'] = $myConsData[SYSLOG_DATE];
|
||||
$myConsData['LastOccurrence_Date'] = $myConsData[SYSLOG_DATE];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TimeStats
|
||||
|
Loading…
x
Reference in New Issue
Block a user