mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Merge branch 'beta' into devel
This commit is contained in:
commit
8246aa39ee
@ -598,6 +598,27 @@ class LogStreamDB extends LogStream {
|
||||
switch( $myfilter[FILTER_TYPE] )
|
||||
{
|
||||
case FILTER_TYPE_STRING:
|
||||
// --- Either make a LIKE or a equal query!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
|
||||
{
|
||||
// Set addnot to nothing
|
||||
$addnod = "";
|
||||
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
{
|
||||
$szSearchBegin = " = '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$szSearchBegin = " <> '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addnod = "";
|
||||
@ -605,14 +626,6 @@ class LogStreamDB extends LogStream {
|
||||
$addnod = " NOT";
|
||||
// ---
|
||||
|
||||
// --- Either make a LIKE or a equal query!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
|
||||
{
|
||||
$szSearchBegin = " = '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$szSearchBegin = " LIKE '%";
|
||||
$szSearchEnd = "%' ";
|
||||
}
|
||||
@ -622,7 +635,13 @@ class LogStreamDB extends LogStream {
|
||||
if ( $propertyname == SYSLOG_MESSAGE )
|
||||
$addor = " AND ";
|
||||
else
|
||||
{
|
||||
// If we exclude filters, we need to combine with AND
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addor = " OR ";
|
||||
else
|
||||
$addor = " AND ";
|
||||
}
|
||||
// ---
|
||||
|
||||
// Now Create LIKE Filters
|
||||
|
@ -758,11 +758,13 @@ class LogStreamDisk extends LogStream {
|
||||
// Otherwise we use OR Handling!
|
||||
else
|
||||
{
|
||||
$bIsOrFilter = true; // Set isOrFilter to true
|
||||
|
||||
// Include Filter
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
|
||||
{
|
||||
|
||||
// Set isOrFilter to true in this case
|
||||
$bIsOrFilter = true;
|
||||
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
|
||||
{
|
||||
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
|
||||
@ -774,18 +776,20 @@ class LogStreamDisk extends LogStream {
|
||||
$bOrFilter = true;
|
||||
}
|
||||
}
|
||||
// Exclude Filter
|
||||
// Exclude Filter - handeled with AND filtering!
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
|
||||
{
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
|
||||
{
|
||||
if ( strtolower($propertyvalue) != strtolower($myfilter[FILTER_VALUE]) )
|
||||
$bOrFilter = true;
|
||||
// if ( strtolower($propertyvalue) != strtolower($myfilter[FILTER_VALUE]) )
|
||||
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
|
||||
$bEval = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
|
||||
$bOrFilter = true;
|
||||
// if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bEval = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -628,6 +628,27 @@ class LogStreamPDO extends LogStream {
|
||||
switch( $myfilter[FILTER_TYPE] )
|
||||
{
|
||||
case FILTER_TYPE_STRING:
|
||||
// --- Either make a LIKE or a equal query!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
|
||||
{
|
||||
// Set addnot to nothing
|
||||
$addnod = "";
|
||||
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
{
|
||||
$szSearchBegin = " = '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$szSearchBegin = " <> '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addnod = "";
|
||||
@ -635,14 +656,6 @@ class LogStreamPDO extends LogStream {
|
||||
$addnod = " NOT";
|
||||
// ---
|
||||
|
||||
// --- Either make a LIKE or a equal query!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHFULL )
|
||||
{
|
||||
$szSearchBegin = " = '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$szSearchBegin = " LIKE '%";
|
||||
$szSearchEnd = "%' ";
|
||||
}
|
||||
@ -652,16 +665,22 @@ class LogStreamPDO extends LogStream {
|
||||
if ( $propertyname == SYSLOG_MESSAGE )
|
||||
$addor = " AND ";
|
||||
else
|
||||
{
|
||||
// If we exclude filters, we need to combine with AND
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addor = " OR ";
|
||||
else
|
||||
$addor = " AND ";
|
||||
}
|
||||
// ---
|
||||
|
||||
// Not create LIKE Filters
|
||||
if ( isset($tmpfilters[$propertyname]) )
|
||||
$tmpfilters[$propertyname][FILTER_VALUE] .= $addor . $dbmapping[$szTableType][$propertyname] . $addnod . $szSearchBegin . DB_RemoveBadChars($myfilter[FILTER_VALUE]) . $szSearchEnd;
|
||||
$tmpfilters[$propertyname][FILTER_VALUE] .= $addor . $dbmapping[$szTableType][$propertyname] . $addnod . $szSearchBegin . DB_RemoveBadChars($myfilter[FILTER_VALUE], $this->_logStreamConfigObj->DBType) . $szSearchEnd;
|
||||
else
|
||||
{
|
||||
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_STRING;
|
||||
$tmpfilters[$propertyname][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . $addnod . $szSearchBegin . DB_RemoveBadChars($myfilter[FILTER_VALUE]) . $szSearchEnd;
|
||||
$tmpfilters[$propertyname][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . $addnod . $szSearchBegin . DB_RemoveBadChars($myfilter[FILTER_VALUE], $this->_logStreamConfigObj->DBType) . $szSearchEnd;
|
||||
}
|
||||
break;
|
||||
case FILTER_TYPE_NUMBER:
|
||||
@ -675,7 +694,7 @@ class LogStreamPDO extends LogStream {
|
||||
else
|
||||
{
|
||||
$tmpfilters[$szArrayKey][FILTER_TYPE] = FILTER_TYPE_NUMBER;
|
||||
$tmpfilters[$szArrayKey][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . " NOT IN (" . DB_RemoveBadChars($myfilter[FILTER_VALUE]);
|
||||
$tmpfilters[$szArrayKey][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . " NOT IN (" . DB_RemoveBadChars($myfilter[FILTER_VALUE], $this->_logStreamConfigObj->DBType);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -686,7 +705,7 @@ class LogStreamPDO extends LogStream {
|
||||
else
|
||||
{
|
||||
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_NUMBER;
|
||||
$tmpfilters[$propertyname][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . " IN (" . DB_RemoveBadChars($myfilter[FILTER_VALUE]);
|
||||
$tmpfilters[$propertyname][FILTER_VALUE] = $dbmapping[$szTableType][$propertyname] . " IN (" . DB_RemoveBadChars($myfilter[FILTER_VALUE], $this->_logStreamConfigObj->DBType);
|
||||
}
|
||||
}
|
||||
// ---
|
||||
|
@ -87,6 +87,18 @@ define('CHARTDATA_COUNT', 'COUNT');
|
||||
define('UID_UNKNOWN', -1);
|
||||
// ---
|
||||
|
||||
// --- Define possible database types
|
||||
define('DB_MYSQL', 0);
|
||||
define('DB_MSSQL', 1);
|
||||
define('DB_ODBC', 2);
|
||||
define('DB_PGSQL', 3);
|
||||
define('DB_OCI', 4);
|
||||
define('DB_DB2', 5);
|
||||
define('DB_FIREBIRD', 6);
|
||||
define('DB_INFORMIX', 7);
|
||||
define('DB_SQLITE', 8);
|
||||
// ---
|
||||
|
||||
// --- Syslog specific defines!
|
||||
define('SYSLOG_KERN', 0);
|
||||
define('SYSLOG_USER', 1);
|
||||
|
@ -77,18 +77,6 @@ define('FILTER_TYPE_NUMBER', 1);
|
||||
define('FILTER_TYPE_DATE', 2);
|
||||
define('FILTER_TYPE_UNKNOWN', 99);
|
||||
|
||||
// Define possible database types
|
||||
define('DB_MYSQL', 0);
|
||||
define('DB_MSSQL', 1);
|
||||
define('DB_ODBC', 2);
|
||||
define('DB_PGSQL', 3);
|
||||
define('DB_OCI', 4);
|
||||
define('DB_DB2', 5);
|
||||
define('DB_FIREBIRD', 6);
|
||||
define('DB_INFORMIX', 7);
|
||||
define('DB_SQLITE', 8);
|
||||
|
||||
|
||||
// --- Predefine fields array!
|
||||
$fields[SYSLOG_UID]['FieldID'] = SYSLOG_UID;
|
||||
$fields[SYSLOG_UID]['FieldCaptionID'] = 'LN_FIELDS_UID';
|
||||
|
@ -236,13 +236,23 @@ function DB_RemoveParserSpecialBadChars($myString)
|
||||
return $returnstr;
|
||||
}
|
||||
|
||||
function DB_RemoveBadChars($myString)
|
||||
function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL)
|
||||
{
|
||||
if ( $dbEngine == DB_MSSQL )
|
||||
{
|
||||
// MSSQL needs special treatment -.-
|
||||
return str_replace("'","''",$myString);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Replace with internal PHP Functions!
|
||||
if ( !get_magic_quotes_runtime() )
|
||||
return addslashes($myString);
|
||||
// return addcslashes($myString, "'");
|
||||
else
|
||||
return $myString;
|
||||
}
|
||||
|
||||
/*
|
||||
$returnstr = str_replace("\\","\\\\",$myString);
|
||||
$returnstr = str_replace("'","\\'",$returnstr);
|
||||
|
306
src/index.php
306
src/index.php
@ -375,30 +375,8 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $facility_colors[SYSLOG_LOCAL0] . '" ';
|
||||
}
|
||||
|
||||
// Set OnClick Menu for SYSLOG_FACILITY
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+facility%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], GetFacilityDisplayName($logArray[$mycolkey]) ),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=facility%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], GetFacilityDisplayName($logArray[$mycolkey]) ),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_FACILITY . '&q=' . GetFacilityDisplayName($logArray[$mycolkey]),
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_FACILITY'] . " '" . GetFacilityDisplayName($logArray[$mycolkey]) . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_NUMBER, SYSLOG_FACILITY, 'LN_FIELDS_FACILITY', true);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_SEVERITY )
|
||||
{
|
||||
@ -416,30 +394,8 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $severity_colors[SYSLOG_INFO] . '" ';
|
||||
}
|
||||
|
||||
// Set OnClick Menu for SYSLOG_SEVERITY
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+severity%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], GetSeverityDisplayName($logArray[$mycolkey]) ),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=severity%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], GetSeverityDisplayName($logArray[$mycolkey]) ),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_SEVERITY . '&q=' . GetSeverityDisplayName($logArray[$mycolkey]),
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_SEVERITY'] . " '" . GetSeverityDisplayName($logArray[$mycolkey]) . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_NUMBER, SYSLOG_SEVERITY, 'LN_FIELDS_SEVERITY', true);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_MESSAGETYPE )
|
||||
{
|
||||
@ -457,97 +413,24 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = 'bgcolor="' . $msgtype_colors[IUT_Unknown] . '" ';
|
||||
}
|
||||
|
||||
// Set OnClick Menu for SYSLOG_MESSAGETYPE
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+messagetype%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], GetMessageTypeDisplayName($logArray[$mycolkey]) ),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=messagetype%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], GetMessageTypeDisplayName($logArray[$mycolkey]) ),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_NUMBER, SYSLOG_MESSAGETYPE, 'LN_FIELDS_MESSAGETYPE', false);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_PROCESSID )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_EVENT_ID
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+processid%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=processid%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_NUMBER, SYSLOG_PROCESSID, 'LN_FIELDS_PROCESSID', false);
|
||||
}
|
||||
/* Eventlog based fields */
|
||||
else if ( $mycolkey == SYSLOG_EVENT_ID )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_EVENT_ID
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventid%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=eventid%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_EVENT_ID . '&q=' . $logArray[$mycolkey],
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_EVENTID'] . " '" . $logArray[$mycolkey] . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_NUMBER, SYSLOG_EVENT_ID, 'LN_FIELDS_EVENTID', true);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_EVENT_CATEGORY )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_EVENT_ID
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventcategory%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=eventcategory%3A' . $logArray[$mycolkey] . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_NUMBER, SYSLOG_EVENT_CATEGORY, 'LN_FIELDS_EVENTCATEGORY', false);
|
||||
}
|
||||
// WebServer Type fields
|
||||
else if ( $mycolkey == SYSLOG_WEBLOG_STATUS )
|
||||
@ -657,129 +540,29 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_SYSLOGTAG )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_SYSLOGTAG
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+syslogtag%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=syslogtag%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_SYSLOGTAG . '&q=' . $logArray[$mycolkey],
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_SYSLOGTAG'] . " '" . $logArray[$mycolkey] . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_STRING, SYSLOG_SYSLOGTAG, 'LN_FIELDS_SYSLOGTAG', true);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_HOST )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_HOST
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+source%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=source%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_STRING, SYSLOG_HOST, 'LN_FIELDS_HOST', false);
|
||||
}
|
||||
/* Eventlog based fields */
|
||||
else if ( $mycolkey == SYSLOG_EVENT_LOGTYPE )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_EVENT_LOGTYPE
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventlogtype%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=eventlogtype%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_EVENT_LOGTYPE . '&q=' . $logArray[$mycolkey],
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_EVENTLOGTYPE'] . " '" . $logArray[$mycolkey] . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_STRING, SYSLOG_EVENT_LOGTYPE, 'LN_FIELDS_EVENTLOGTYPE', true);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_EVENT_SOURCE )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_EVENT_SOURCE
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventlogsource%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=eventlogsource%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . SYSLOG_EVENT_SOURCE . '&q=' . $logArray[$mycolkey],
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content['LN_FIELDS_EVENTSOURCE'] . " '" . $logArray[$mycolkey] . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_STRING, SYSLOG_EVENT_SOURCE, 'LN_FIELDS_EVENTSOURCE', true);
|
||||
}
|
||||
else if ( $mycolkey == SYSLOG_EVENT_USER )
|
||||
{
|
||||
// Set OnClick Menu for SYSLOG_EVENT_USER
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+eventuser%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=eventuser%3A%3D' . urlencode($content['syslogmessages'][$counter]['values'][$mycolkey]['encodedfieldvalue']) . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $logArray[$mycolkey]),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
// Add context menu
|
||||
AddOnClickMenu( $content['syslogmessages'][$counter]['values'][$mycolkey], FILTER_TYPE_STRING, SYSLOG_EVENT_USER, 'LN_FIELDS_EVENTUSER', false);
|
||||
}
|
||||
// WebServer Type fields
|
||||
else if ( $mycolkey == SYSLOG_WEBLOG_USER )
|
||||
@ -986,9 +769,9 @@ function PrepareStringForSearch($myString)
|
||||
return str_replace($searchArray, $replaceArray, $myString);
|
||||
}
|
||||
|
||||
function AddOnClickMenu(&$fieldGridItem, $fieldType, $szSearchFieldName, $szFieldDisplayNameID, $searchOnline = false)
|
||||
function AddOnClickMenu(&$fieldGridItem, $fieldType, $FieldID, $szFieldDisplayNameID, $searchOnline = false)
|
||||
{
|
||||
global $content;
|
||||
global $content, $fields, $myStrCharLimit;
|
||||
|
||||
// Set OnClick Menu for SYSLOG_SYSLOGTAG
|
||||
$fieldGridItem['hasbuttons'] = true;
|
||||
@ -999,32 +782,71 @@ function AddOnClickMenu(&$fieldGridItem, $fieldType, $szSearchFieldName, $szFie
|
||||
else
|
||||
$szEncodedFieldValue = $fieldGridItem['fieldvalue'];
|
||||
|
||||
// Set FieldSearchName
|
||||
if ( isset($fields[$FieldID]['SearchField']) )
|
||||
$szSearchFieldName = $fields[$FieldID]['SearchField'];
|
||||
else
|
||||
$szSearchFieldName = $FieldID;
|
||||
|
||||
// Menu Option to append filter
|
||||
if ( strlen($content['searchstr']) > 0 )
|
||||
{
|
||||
$fieldGridItem['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+' . $szSearchFieldName . '%3A%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'ButtonTarget' => '_top',
|
||||
'ButtonAppendUrl' => true,
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_ADDTOFILTER'], $fieldGridItem['fieldvalue']),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
$fieldGridItem['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . urlencode($content['searchstr']) . '+' . $szSearchFieldName . '%3A-%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'ButtonTarget' => '_top',
|
||||
'ButtonAppendUrl' => true,
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_EXCLUDEFILTER'], $fieldGridItem['fieldvalue']),
|
||||
'IconSource' => $content['MENU_BULLET_GREEN']
|
||||
);
|
||||
}
|
||||
|
||||
// More Menu entries
|
||||
$fieldGridItem['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . $szSearchFieldName . '%3A%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'ButtonTarget' => '_top',
|
||||
'ButtonAppendUrl' => true,
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_FILTERFORONLY'], $fieldGridItem['fieldvalue']),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
$fieldGridItem['buttons'][] = array(
|
||||
'ButtonUrl' => '?filter=' . $szSearchFieldName . '%3A-%3D' . $szEncodedFieldValue . '&search=Search' . $content['additional_url_sourceonly'],
|
||||
'ButtonTarget' => '_top',
|
||||
'ButtonAppendUrl' => true,
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_SHOWALLBUT'], $fieldGridItem['fieldvalue']),
|
||||
'IconSource' => $content['MENU_BULLET_BLUE']
|
||||
);
|
||||
|
||||
// Add Online Search Button
|
||||
if ( $searchOnline )
|
||||
{
|
||||
$fieldGridItem['buttons'][] = array(
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . $szSearchFieldName . '&q=' . $szEncodedFieldValue,
|
||||
'ButtonUrl' => 'http://kb.monitorware.com/kbsearch.php?sa=Search&origin=phplogcon&oid=' . $FieldID . '&q=' . $szEncodedFieldValue,
|
||||
'ButtonTarget' => '_top',
|
||||
'ButtonAppendUrl' => true,
|
||||
'DisplayName' => $content['LN_VIEW_SEARCHFOR'] . " " . $content[$szFieldDisplayNameID] . " '" . $fieldGridItem['fieldvalue'] . "'",
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
}
|
||||
|
||||
// Search for links within the fieldcontent!
|
||||
if ( $fieldType == FILTER_TYPE_STRING && preg_match("#([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", $fieldGridItem['rawfieldvalue'], $szLink) >= 1 )
|
||||
{
|
||||
$fieldGridItem['buttons'][] = array(
|
||||
'ButtonUrl' => $szLink[0],
|
||||
'ButtonTarget' => '_blank',
|
||||
'ButtonAppendUrl' => false,
|
||||
'DisplayName' => GetAndReplaceLangStr($content['LN_VIEW_VISITLINK'], strlen($szLink[0]) > $myStrCharLimit ? substr($szLink[0], 0, $myStrCharLimit) . "..." : $szLink[0] ),
|
||||
'IconSource' => $content['MENU_NETWORK']
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
// ---
|
||||
|
||||
|
@ -129,7 +129,10 @@ $content['LN_SEARCH_PERFORMADVANCED'] = "Erweiterte Suche starten";
|
||||
$content['LN_VIEW_SEARCHFORGOOGLE'] = "Search Google for ";
|
||||
$content['LN_GEN_MESSAGEDETAILS'] = "Message Details";
|
||||
$content['LN_VIEW_ADDTOFILTER'] = "Add '%1' to filterset";
|
||||
$content['LN_VIEW_EXCLUDEFILTER'] = "Exclude '%1' from filterset";
|
||||
$content['LN_VIEW_FILTERFORONLY'] = "Filter for '%1' only";
|
||||
$content['LN_VIEW_SHOWALLBUT'] = "Show all except '%1'";
|
||||
$content['LN_VIEW_VISITLINK'] = "Open Link '%1' in new window";
|
||||
|
||||
$content['LN_HIGHLIGHT'] = "Hightlight >>";
|
||||
$content['LN_HIGHLIGHT_OFF'] = "Hightlight <<";
|
||||
|
@ -130,7 +130,10 @@ $content['LN_VIEW_SEARCHFOR'] = "Search online for ";
|
||||
$content['LN_VIEW_SEARCHFORGOOGLE'] = "Search Google for ";
|
||||
$content['LN_GEN_MESSAGEDETAILS'] = "Message Details";
|
||||
$content['LN_VIEW_ADDTOFILTER'] = "Add '%1' to filterset";
|
||||
$content['LN_VIEW_EXCLUDEFILTER'] = "Exclude '%1' from filterset";
|
||||
$content['LN_VIEW_FILTERFORONLY'] = "Filter for '%1' only";
|
||||
$content['LN_VIEW_SHOWALLBUT'] = "Show all except '%1'";
|
||||
$content['LN_VIEW_VISITLINK'] = "Open Link '%1' in new window";
|
||||
|
||||
$content['LN_HIGHLIGHT'] = "Hightlight >>";
|
||||
$content['LN_HIGHLIGHT_OFF'] = "Hightlight <<";
|
||||
|
@ -132,7 +132,10 @@ $content['LN_VIEW_SEARCHFOR'] = "Busca online por ";
|
||||
$content['LN_VIEW_SEARCHFORGOOGLE'] = "Busca no Google por ";
|
||||
$content['LN_GEN_MESSAGEDETAILS'] = "Detalhes da Mensagem";
|
||||
$content['LN_VIEW_ADDTOFILTER'] = "Add '%1' to filterset";
|
||||
$content['LN_VIEW_EXCLUDEFILTER'] = "Exclude '%1' from filterset";
|
||||
$content['LN_VIEW_FILTERFORONLY'] = "Filter for '%1' only";
|
||||
$content['LN_VIEW_SHOWALLBUT'] = "Show all except '%1'";
|
||||
$content['LN_VIEW_VISITLINK'] = "Open Link '%1' in new window";
|
||||
|
||||
$content['LN_HIGHLIGHT'] = "Destacar >>";
|
||||
$content['LN_HIGHLIGHT_OFF'] = "Destacar <<";
|
||||
|
@ -263,7 +263,7 @@
|
||||
<h2>{LN_GEN_AVAILABLESEARCHES}</h2>
|
||||
<!-- BEGIN buttons -->
|
||||
<li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_{FieldColumn}_{uid}');">
|
||||
<img align="left" src="{IconSource}" width="16" height="16" vspace="2"><a href="{ButtonUrl}{additional_url_sourceonly}" target="_top" OnClick="ToggleDisplayOffTypeById('menu_{FieldColumn}_{uid}');">{DisplayName}</a>
|
||||
<img align="left" src="{IconSource}" width="16" height="16" vspace="2"><a href="{ButtonUrl}<!-- IF ButtonAppendUrl="true" -->{additional_url_sourceonly}<!-- ENDIF ButtonAppendUrl="true" -->" target="{ButtonTarget}" OnClick="ToggleDisplayOffTypeById('menu_{FieldColumn}_{uid}');">{DisplayName}</a>
|
||||
</li>
|
||||
<!-- END buttons -->
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user