Added filtering support for the new Eventlog fields

This commit is contained in:
Andre Lorbach 2008-05-05 17:07:08 +02:00
parent 6b3dccaf18
commit 3c2e2ee27e
2 changed files with 62 additions and 2 deletions

View File

@ -340,6 +340,35 @@ abstract class LogStream {
}
// ---
break;
/* BEGIN Eventlog based fields */
case "eventid":
$tmpKeyName = SYSLOG_EVENT_ID;
$tmpFilterType = FILTER_TYPE_NUMBER;
// --- Extra numeric Check
if ( isset($tmpValues) )
{
foreach( $tmpValues as $mykey => $szValue )
{
if ( is_numeric($szValue) )
$tmpValues[$mykey] = $szValue;
}
}
else
{
if ( !is_numeric($tmpArray[FILTER_TMP_VALUE]) )
$tmpArray[FILTER_TMP_VALUE] = "";
}
// ---
break;
case "eventlogtype":
$tmpKeyName = SYSLOG_EVENT_LOGTYPE;
$tmpFilterType = FILTER_TYPE_STRING;
break;
case "eventlogsource":
$tmpKeyName = SYSLOG_EVENT_SOURCE;
$tmpFilterType = FILTER_TYPE_STRING;
break;
/* END Eventlog based fields */
case "syslogtag":
$tmpKeyName = SYSLOG_SYSLOGTAG;
$tmpFilterType = FILTER_TYPE_STRING;

View File

@ -386,8 +386,19 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . GetMessageTypeDisplayName( $logArray[$mycolkey] ). "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
/* Eventlog based fields */
else if ( $mycolkey == SYSLOG_EVENT_ID )
{
// Set OnClick Menu for SYSLOG_EVENT_ID
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=eventid%3A' . $logArray[$mycolkey] . '&search=Search',
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
}
else if ( $content['fields'][$mycolkey]['FieldType'] == FILTER_TYPE_STRING )
{
@ -483,7 +494,27 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
/* Eventlog based fields */
else if ( $mycolkey == SYSLOG_EVENT_LOGTYPE )
{
// Set OnClick Menu for SYSLOG_EVENT_LOGTYPE
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=eventlogtype%3A' . $logArray[$mycolkey] . '&search=Search',
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
else if ( $mycolkey == SYSLOG_EVENT_SOURCE )
{
// Set OnClick Menu for SYSLOG_EVENT_SOURCE
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=eventlogsource%3A' . $logArray[$mycolkey] . '&search=Search',
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'",
'IconSource' => $content['MENU_BULLET_BLUE']
);
}
}
}
}