mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Merge branch 'beta' into devel
Conflicts: src/include/functions_common.php
This commit is contained in:
commit
110d278aa7
29
ChangeLog
29
ChangeLog
@ -1,4 +1,33 @@
|
||||
---------------------------------------------------------------------------
|
||||
Version 2.5.16 (beta), 2008-10-27
|
||||
- Fixed a problem when adding a mysql logstream source. Due a problem of
|
||||
how php mysql_connect function handels second conenctions, the Verify
|
||||
of a newly added logstream source could cause the first database
|
||||
connection to be overwritten. The following error is, that the wrong
|
||||
database was used for the UserDB after the new logstream was verified.
|
||||
- Added a check into the redirect function to STOP redirecting if an
|
||||
error happens in the UserDB.
|
||||
- Fixed minor issues handling form input which happened when
|
||||
magic_quotes_gpc was enabled.
|
||||
- Fixed a bug in the convert.php script which inserted the wrong
|
||||
database version number. This caused phpLogCon to force an database
|
||||
upgrade which is not needed at all.
|
||||
- Added dummy db update scripts, so the db upgrade script won't fail
|
||||
in future. This is for the case when the db version is not correctly
|
||||
or missing in the user database.
|
||||
- Added support to filter for dynamic fields within the logstream
|
||||
database sources. This was not possible yet. The filtering also has a
|
||||
secure end timer, which avoids that the timelimit hits the script.
|
||||
- Added support to suppress unparseable messages when using msgparsers.
|
||||
This enhances useability if you have mixed data sources, and want to
|
||||
filter out unparseable messages.
|
||||
- Added new setting for MYSQL logstream sources to control the amount
|
||||
of data per query. This value can be used to tweak the MYSQL
|
||||
performance. For example when filtering for fields which are generated
|
||||
by a message parser, highering the value does improve the database
|
||||
performance. The default value is 100, and should only be changed if
|
||||
you know what you are doing.
|
||||
---------------------------------------------------------------------------
|
||||
Version 2.5.15 (beta), 2008-10-22
|
||||
- Corrected the check for magic_quotes_gpc which is important when saving
|
||||
configuration values are saved into the UserDB. This also fixes a
|
||||
|
@ -280,7 +280,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENADDED'], $content['Name'] ) , "charts.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENADDED'], DB_StripSlahes($content['Name']) ) , "charts.php" );
|
||||
}
|
||||
else if ( $_POST['op'] == "editchart" )
|
||||
{
|
||||
@ -309,7 +309,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENEDIT'], $content['Name']) , "charts.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_CHARTS_HASBEENEDIT'], DB_StripSlahes($content['Name']) ) , "charts.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENADDED'], $content['FieldCaption'] ) , "fields.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENADDED'], DB_StripSlahes($content['FieldCaption']) ) , "fields.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -267,7 +267,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENEDIT'], $content['FieldCaption']) , "fields.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_FIELDS_HASBEENEDIT'], DB_StripSlahes($content['FieldCaption']) ) , "fields.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], $content['groupname'] ) , "groups.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], DB_StripSlahes($content['groupname']) ) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "editgroup" )
|
||||
@ -344,7 +344,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], $content['groupname']) , "groups.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], DB_StripSlahes($content['groupname']) ) , "groups.php" );
|
||||
}
|
||||
}
|
||||
else if ( $_POST['op'] == "adduser" )
|
||||
|
@ -71,7 +71,7 @@ else
|
||||
}
|
||||
|
||||
if ( isset($_GET['msg']) )
|
||||
$content['SZMSG'] = urldecode($_GET['msg']);
|
||||
$content['SZMSG'] = DB_StripSlahes($_GET['msg']);
|
||||
else
|
||||
$content['SZMSG'] = $content["LN_ADMIN_UNKNOWNSTATE"];
|
||||
|
||||
|
@ -235,7 +235,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], $content['DisplayName'] ) , "searches.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], DB_StripSlahes($content['DisplayName']) ) , "searches.php" );
|
||||
}
|
||||
else if ( $_POST['op'] == "editsearch" )
|
||||
{
|
||||
@ -258,7 +258,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], $content['DisplayName']) , "searches.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], DB_StripSlahes($content['DisplayName']) ) , "searches.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,9 @@ if ( isset($_GET['op']) )
|
||||
CreateSourceTypesList($content['SourceType']);
|
||||
$content['MsgParserList'] = "";
|
||||
$content['MsgNormalize'] = 0;
|
||||
$content['MsgSkipUnparseable'] = 0;
|
||||
$content['CHECKED_ISNORMALIZEMSG'] = "";
|
||||
$content['CHECKED_ISSKIPUNPARSEABLE'] = "";
|
||||
|
||||
// Init View List!
|
||||
$content['SourceViewID'] = 'SYSLOG';
|
||||
@ -100,6 +102,7 @@ if ( isset($_GET['op']) )
|
||||
$content['SourceDBEnableRowCounting'] = "false";
|
||||
$content['SourceDBEnableRowCounting_true'] = "";
|
||||
$content['SourceDBEnableRowCounting_false'] = "checked";
|
||||
$content['SourceDBRecordsPerQuery'] = "100";
|
||||
|
||||
// General stuff
|
||||
$content['userid'] = null;
|
||||
@ -143,6 +146,13 @@ if ( isset($_GET['op']) )
|
||||
else
|
||||
$content['CHECKED_ISNORMALIZEMSG'] = "";
|
||||
|
||||
$content['MsgSkipUnparseable'] = $mysource['MsgSkipUnparseable'];
|
||||
if ( $mysource['MsgSkipUnparseable'] == 1 )
|
||||
$content['CHECKED_ISSKIPUNPARSEABLE'] = "checked";
|
||||
else
|
||||
$content['CHECKED_ISSKIPUNPARSEABLE'] = "";
|
||||
|
||||
|
||||
// Init View List!
|
||||
$content['SourceViewID'] = $mysource['ViewID'];
|
||||
$content['VIEWS'] = $content['Views'];
|
||||
@ -179,6 +189,8 @@ if ( isset($_GET['op']) )
|
||||
$content['SourceDBEnableRowCounting_true'] = "";
|
||||
$content['SourceDBEnableRowCounting_false'] = "checked";
|
||||
}
|
||||
$content['SourceDBRecordsPerQuery'] = $mysource['DBRecordsPerQuery'];
|
||||
|
||||
|
||||
if ( $mysource['userid'] != null )
|
||||
$content['CHECKED_ISUSERONLY'] = "checked";
|
||||
@ -273,6 +285,7 @@ if ( isset($_POST['op']) )
|
||||
if ( isset($_POST['SourceType']) ) { $content['SourceType'] = DB_RemoveBadChars($_POST['SourceType']); }
|
||||
if ( isset($_POST['MsgParserList']) ) { $content['MsgParserList'] = DB_RemoveBadChars($_POST['MsgParserList']); }
|
||||
if ( isset($_POST['MsgNormalize']) ) { $content['MsgNormalize'] = intval(DB_RemoveBadChars($_POST['MsgNormalize'])); } else {$content['MsgNormalize'] = 0; }
|
||||
if ( isset($_POST['MsgSkipUnparseable']) ) { $content['MsgSkipUnparseable'] = intval(DB_RemoveBadChars($_POST['MsgSkipUnparseable'])); } else {$content['MsgSkipUnparseable'] = 0; }
|
||||
if ( isset($_POST['SourceViewID']) ) { $content['SourceViewID'] = DB_RemoveBadChars($_POST['SourceViewID']); }
|
||||
|
||||
if ( isset($content['SourceType']) )
|
||||
@ -292,6 +305,7 @@ if ( isset($_POST['op']) )
|
||||
if ( isset($_POST['SourceDBServer']) ) { $content['SourceDBServer'] = DB_RemoveBadChars($_POST['SourceDBServer']); }
|
||||
if ( isset($_POST['SourceDBTableName']) ) { $content['SourceDBTableName'] = DB_RemoveBadChars($_POST['SourceDBTableName']); }
|
||||
if ( isset($_POST['SourceDBUser']) ) { $content['SourceDBUser'] = DB_RemoveBadChars($_POST['SourceDBUser']); }
|
||||
if ( isset($_POST['SourceDBRecordsPerQuery']) ) { $content['SourceDBRecordsPerQuery'] = DB_RemoveBadChars($_POST['SourceDBRecordsPerQuery']); }
|
||||
if ( isset($_POST['SourceDBPassword']) ) { $content['SourceDBPassword'] = DB_RemoveBadChars($_POST['SourceDBPassword']); } else {$content['SourceDBPassword'] = ""; }
|
||||
if ( isset($_POST['SourceDBEnableRowCounting']) ) { $content['SourceDBEnableRowCounting'] = DB_RemoveBadChars($_POST['SourceDBEnableRowCounting']); }
|
||||
// Extra Check for this property
|
||||
@ -407,6 +421,11 @@ if ( isset($_POST['op']) )
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBUSER'] );
|
||||
}
|
||||
else if ( !is_numeric($content['SourceDBRecordsPerQuery']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_INVALIDVALUE'], $content['LN_CFG_DBRECORDSPERQUERY'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -420,13 +439,14 @@ if ( isset($_POST['op']) )
|
||||
include($gl_root_path . 'classes/logstream.class.php');
|
||||
|
||||
// First create a tmp source array
|
||||
$tmpSource['ID'] = $content['SOURCEID'];
|
||||
$tmpSource['Name'] = $content['Name'];
|
||||
$tmpSource['Description'] = $content['Description'];
|
||||
$tmpSource['SourceType'] = $content['SourceType'];
|
||||
$tmpSource['MsgParserList'] = $content['MsgParserList'];
|
||||
$tmpSource['MsgNormalize'] = $content['MsgNormalize'];
|
||||
$tmpSource['ViewID'] = $content['SourceViewID'];
|
||||
$tmpSource['ID'] = $content['SOURCEID'];
|
||||
$tmpSource['Name'] = $content['Name'];
|
||||
$tmpSource['Description'] = $content['Description'];
|
||||
$tmpSource['SourceType'] = $content['SourceType'];
|
||||
$tmpSource['MsgParserList'] = $content['MsgParserList'];
|
||||
$tmpSource['MsgNormalize'] = $content['MsgNormalize'];
|
||||
$tmpSource['MsgSkipUnparseable']= $content['MsgSkipUnparseable'];
|
||||
$tmpSource['ViewID'] = $content['SourceViewID'];
|
||||
if ( $tmpSource['SourceType'] == SOURCE_DISK )
|
||||
{
|
||||
$tmpSource['LogLineType'] = $content['SourceLogLineType'];
|
||||
@ -442,7 +462,8 @@ if ( isset($_POST['op']) )
|
||||
$tmpSource['DBTableName'] = $content['SourceDBTableName'];
|
||||
$tmpSource['DBUser'] = $content['SourceDBUser'];
|
||||
$tmpSource['DBPassword'] = $content['SourceDBPassword'];
|
||||
$tmpSource['DBEnableRowCounting'] = $content['SourceDBEnableRowCounting'];
|
||||
$tmpSource['DBEnableRowCounting'] = $content['SourceDBEnableRowCounting'];
|
||||
$tmpSource['DBRecordsPerQuery'] = $content['SourceDBRecordsPerQuery'];
|
||||
$tmpSource['userid'] = $content['userid'];
|
||||
$tmpSource['groupid'] = $content['groupid'];
|
||||
}
|
||||
@ -473,12 +494,13 @@ if ( isset($_POST['op']) )
|
||||
// Add custom search now!
|
||||
if ( $content['SourceType'] == SOURCE_DISK )
|
||||
{
|
||||
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, ViewID, LogLineType, DiskFile, userid, groupid)
|
||||
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, MsgSkipUnparseable, ViewID, LogLineType, DiskFile, userid, groupid)
|
||||
VALUES ('" . $content['Name'] . "',
|
||||
'" . $content['Description'] . "',
|
||||
" . $content['SourceType'] . ",
|
||||
'" . $content['MsgParserList'] . "',
|
||||
" . $content['MsgNormalize'] . ",
|
||||
" . $content['MsgSkipUnparseable'] . ",
|
||||
'" . $content['SourceViewID'] . "',
|
||||
'" . $content['SourceLogLineType'] . "',
|
||||
'" . $content['SourceDiskFile'] . "',
|
||||
@ -488,12 +510,13 @@ if ( isset($_POST['op']) )
|
||||
}
|
||||
else if ( $content['SourceType'] == SOURCE_DB || $content['SourceType'] == SOURCE_PDO )
|
||||
{
|
||||
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, ViewID, DBTableType, DBType, DBServer, DBName, DBUser, DBPassword, DBTableName, DBEnableRowCounting, userid, groupid)
|
||||
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, Description, SourceType, MsgParserList, MsgNormalize, MsgSkipUnparseable, ViewID, DBTableType, DBType, DBServer, DBName, DBUser, DBPassword, DBTableName, DBEnableRowCounting, SourceDBRecordsPerQuery, userid, groupid)
|
||||
VALUES ('" . $content['Name'] . "',
|
||||
'" . $content['Description'] . "',
|
||||
" . $content['SourceType'] . ",
|
||||
'" . $content['MsgParserList'] . "',
|
||||
" . $content['MsgNormalize'] . ",
|
||||
" . $content['MsgSkipUnparseable'] . ",
|
||||
'" . $content['SourceViewID'] . "',
|
||||
'" . $content['SourceDBTableType'] . "',
|
||||
" . $content['SourceDBType'] . ",
|
||||
@ -503,6 +526,7 @@ if ( isset($_POST['op']) )
|
||||
'" . $content['SourceDBPassword'] . "',
|
||||
'" . $content['SourceDBTableName'] . "',
|
||||
" . $content['SourceDBEnableRowCounting'] . ",
|
||||
" . $content['SourceDBRecordsPerQuery'] . ",
|
||||
" . $content['userid'] . ",
|
||||
" . $content['groupid'] . "
|
||||
)";
|
||||
@ -512,7 +536,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCE_HASBEENADDED'], $content['Name'] ) , "sources.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCE_HASBEENADDED'], DB_StripSlahes($content['Name']) ) , "sources.php" );
|
||||
}
|
||||
else if ( $_POST['op'] == "editsource" )
|
||||
{
|
||||
@ -534,6 +558,7 @@ if ( isset($_POST['op']) )
|
||||
SourceType = " . $content['SourceType'] . ",
|
||||
MsgParserList = '" . $content['MsgParserList'] . "',
|
||||
MsgNormalize = " . $content['MsgNormalize'] . ",
|
||||
MsgSkipUnparseable = " . $content['MsgSkipUnparseable'] . ",
|
||||
ViewID = '" . $content['SourceViewID'] . "',
|
||||
LogLineType = '" . $content['SourceLogLineType'] . "',
|
||||
DiskFile = '" . $content['SourceDiskFile'] . "',
|
||||
@ -549,6 +574,7 @@ if ( isset($_POST['op']) )
|
||||
SourceType = " . $content['SourceType'] . ",
|
||||
MsgParserList = '" . $content['MsgParserList'] . "',
|
||||
MsgNormalize = " . $content['MsgNormalize'] . ",
|
||||
MsgSkipUnparseable = " . $content['MsgSkipUnparseable'] . ",
|
||||
ViewID = '" . $content['SourceViewID'] . "',
|
||||
DBTableType = '" . $content['SourceDBTableType'] . "',
|
||||
DBType = " . $content['SourceDBType'] . ",
|
||||
@ -558,6 +584,7 @@ if ( isset($_POST['op']) )
|
||||
DBPassword = '" . $content['SourceDBPassword'] . "',
|
||||
DBTableName = '" . $content['SourceDBTableName'] . "',
|
||||
DBEnableRowCounting = " . $content['SourceDBEnableRowCounting'] . ",
|
||||
DBRecordsPerQuery = " . $content['SourceDBRecordsPerQuery'] . ",
|
||||
userid = " . $content['userid'] . ",
|
||||
groupid = " . $content['groupid'] . "
|
||||
WHERE ID = " . $content['SOURCEID'];
|
||||
@ -567,7 +594,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCES_HASBEENEDIT'], $content['Name']) , "sources.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCES_HASBEENEDIT'], DB_StripSlahes($content['Name']) ) , "sources.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], $content['USERNAME'] ) , "users.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], DB_StripSlahes($content['USERNAME']) ) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -322,7 +322,7 @@ if ( isset($_POST['op']) )
|
||||
}
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], $content['USERNAME']) , "users.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], DB_StripSlahes($content['USERNAME']) ) , "users.php" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ if ( isset($content['ISEDITORNEWVIEW']) && $content['ISEDITORNEWVIEW'] )
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['VIEWID'] = DB_RemoveBadChars($_POST['id']); } else {$content['VIEWID'] = ""; }
|
||||
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
|
||||
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_StripSlahes($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
|
||||
|
||||
// User & Group handeled specially
|
||||
if ( isset ($_POST['isuseronly']) )
|
||||
@ -316,6 +316,9 @@ if ( isset($_POST['op']) )
|
||||
// Add New entry into columnlist
|
||||
$content['SUBCOLUMNS'][$szColId]['ColFieldID'] = $szColId;
|
||||
|
||||
// Set Internal FieldID
|
||||
$content['SUBCOLUMNS'][$szColId]['ColInternalID'] = $fields[$szColId]['FieldDefine'];
|
||||
|
||||
// Set Fieldcaption
|
||||
if ( isset($fields[$szColId]['FieldCaption']) )
|
||||
$content['SUBCOLUMNS'][$szColId]['ColCaption'] = $fields[$szColId]['FieldCaption'];
|
||||
@ -411,6 +414,9 @@ if ( isset($_POST['op']) )
|
||||
}
|
||||
else // Now SUBOP means normal processing!
|
||||
{
|
||||
// Now we convert fr DB insert!
|
||||
$content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']);
|
||||
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewview" )
|
||||
{
|
||||
@ -437,7 +443,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENADDED'], $content['DisplayName'] ) , "views.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENADDED'], DB_StripSlahes($content['DisplayName']) ) , "views.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -447,6 +453,9 @@ if ( isset($_POST['op']) )
|
||||
}
|
||||
else if ( $_POST['op'] == "editview" )
|
||||
{
|
||||
// Now we convert fr DB insert!
|
||||
$content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']);
|
||||
|
||||
$result = DB_Query("SELECT ID FROM " . DB_VIEWS . " WHERE ID = " . $content['VIEWID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
@ -480,7 +489,7 @@ if ( isset($_POST['op']) )
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENEDIT'], $content['DisplayName']) , "views.php" );
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_VIEWS_HASBEENEDIT'], DB_StripSlahes($content['DisplayName']) ) , "views.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -259,6 +259,219 @@ abstract class LogStream {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of ApplyFilters which can be used by all LogStream Classes!
|
||||
* This function performs a check on the filters and actually triggers the
|
||||
* syslog parsers as well.
|
||||
*/
|
||||
public function ApplyFilters($myResults, &$arrProperitesOut)
|
||||
{
|
||||
// IF result was unsuccessfull, return success - nothing we can do here.
|
||||
if ( $myResults >= ERROR )
|
||||
return SUCCESS;
|
||||
|
||||
// Process all filters
|
||||
if ( $this->_filters != null )
|
||||
{
|
||||
// Evaluation default for now is true
|
||||
$bEval = true;
|
||||
|
||||
// Loop through set properties
|
||||
foreach( $arrProperitesOut as $propertyname => $propertyvalue )
|
||||
{
|
||||
// TODO: NOT SURE IF THIS WILL WORK ON NUMBERS AND OTHER TYPES RIGHT NOW
|
||||
if (
|
||||
array_key_exists($propertyname, $this->_filters) &&
|
||||
isset($propertyvalue) /* &&
|
||||
!(is_string($propertyvalue) && strlen($propertyvalue) <= 0) /* Negative because it only matters if the propvalure is a string*/
|
||||
)
|
||||
{
|
||||
// Extra var needed for number checks!
|
||||
$bIsOrFilter = false; // If enabled we need to check for numbereval later
|
||||
$bOrFilter = false;
|
||||
|
||||
// Found something to filter, so do it!
|
||||
foreach( $this->_filters[$propertyname] as $myfilter )
|
||||
{
|
||||
switch( $myfilter[FILTER_TYPE] )
|
||||
{
|
||||
case FILTER_TYPE_STRING:
|
||||
// Only filter if value is non zero
|
||||
if ( strlen($propertyvalue) > 0 && strlen($myfilter[FILTER_VALUE]) > 0 )
|
||||
{
|
||||
// If Syslog message, we have AND handling!
|
||||
if ( $propertyname == SYSLOG_MESSAGE )
|
||||
{
|
||||
// Include Filter
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
|
||||
$bEval = false;
|
||||
}
|
||||
// Exclude Filter
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bEval = false;
|
||||
}
|
||||
}
|
||||
// Otherwise we use OR Handling!
|
||||
else
|
||||
{
|
||||
// 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]) )
|
||||
$bOrFilter = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bOrFilter = true;
|
||||
}
|
||||
}
|
||||
// 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]) )
|
||||
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
|
||||
$bEval = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bEval = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Either filter value or property value was empty!
|
||||
// This means we have no match
|
||||
$bEval = false;
|
||||
}
|
||||
|
||||
break;
|
||||
case FILTER_TYPE_NUMBER:
|
||||
$bIsOrFilter = true; // Default is set to TRUE
|
||||
if ( is_numeric($arrProperitesOut[$propertyname]) )
|
||||
{
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
|
||||
{
|
||||
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
|
||||
$bOrFilter = true;
|
||||
else
|
||||
$bOrFilter = false;
|
||||
}
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
|
||||
{
|
||||
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
|
||||
$bOrFilter = false;
|
||||
else
|
||||
$bOrFilter = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If wanted, we treat this filter as a success!
|
||||
if ( GetConfigSetting("TreatNotFoundFiltersAsTrue", 0, CFGLEVEL_USER) == 1 )
|
||||
$bOrFilter = true;
|
||||
else
|
||||
$bOrFilter = false;
|
||||
}
|
||||
break;
|
||||
case FILTER_TYPE_DATE:
|
||||
// Get Log TimeStamp
|
||||
$nLogTimeStamp = $arrProperitesOut[$propertyname][EVTIME_TIMESTAMP];
|
||||
|
||||
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
|
||||
{
|
||||
// Get current timestamp
|
||||
$nNowTimeStamp = time();
|
||||
|
||||
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
|
||||
$nLastXTime = 60 * 60; // One Hour!
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
|
||||
$nLastXTime = 60 * 60 * 12; // 12 Hours!
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
|
||||
$nLastXTime = 60 * 60 * 24; // 24 Hours!
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
|
||||
$nLastXTime = 60 * 60 * 24 * 7; // 7 days
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
|
||||
$nLastXTime = 60 * 60 * 24 * 31; // 31 days
|
||||
else
|
||||
// WTF default?
|
||||
$nLastXTime = 86400;
|
||||
|
||||
// If Nowtime + LastX is higher then the log timestamp, the this logline is to old for us.
|
||||
if ( ($nNowTimeStamp - $nLastXTime) > $nLogTimeStamp )
|
||||
$bEval = false;
|
||||
}
|
||||
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_FROM )
|
||||
{
|
||||
// Get filter timestamp!
|
||||
$nFromTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
|
||||
|
||||
// If logtime is smaller then FromTime, then the Event is outside of our scope!
|
||||
if ( $nLogTimeStamp < $nFromTimeStamp )
|
||||
$bEval = false;
|
||||
}
|
||||
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_TO )
|
||||
{
|
||||
// Get filter timestamp!
|
||||
// echo $myfilter[FILTER_VALUE];
|
||||
$nToTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
|
||||
|
||||
// If logtime is smaller then FromTime, then the Event is outside of our scope!
|
||||
if ( $nLogTimeStamp > $nToTimeStamp )
|
||||
$bEval = false;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
// TODO!
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If was number filter, we apply it the evaluation.
|
||||
if ( $bIsOrFilter )
|
||||
$bEval &= $bOrFilter;
|
||||
|
||||
if ( !$bEval )
|
||||
{
|
||||
// unmatching filter, reset property array
|
||||
foreach ( $this->_arrProperties as $property )
|
||||
$arrProperitesOut[$property] = '';
|
||||
|
||||
// return error!
|
||||
return ERROR_FILTER_NOT_MATCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reached this point means filters did match!
|
||||
return SUCCESS;
|
||||
}
|
||||
else // No filters at all means success!
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* --- PIRVATE HELPERS!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Helper function to parse filters into a useful filter array we can work with.
|
||||
*/
|
||||
@ -816,6 +1029,7 @@ abstract class LogStream {
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
@ -53,6 +53,7 @@ abstract class LogStreamConfig {
|
||||
protected $_msgParserList = null; // Contains a string list of configure msg parsers
|
||||
protected $_msgParserObjList = null; // Contains an object reference list to the msg parsers
|
||||
protected $_MsgNormalize = 0; // If set to one, the msg will be reconstructed if successfully parsed before
|
||||
public $_SkipUnparseable = 0; // If set to one, all unparseable message will be ignored! This of course only applies if a msg parser is used
|
||||
|
||||
// Constructor prototype
|
||||
public abstract function LogStreamFactory($o);
|
||||
@ -79,6 +80,17 @@ abstract class LogStreamConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to init Parserlist
|
||||
*/
|
||||
public function SetSkipUnparseable( $nNewVal )
|
||||
{
|
||||
if ( $nNewVal == 0 )
|
||||
$this->_SkipUnparseable = 0;
|
||||
else
|
||||
$this->_SkipUnparseable = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to init Parserlist
|
||||
*/
|
||||
@ -147,6 +159,10 @@ abstract class LogStreamConfig {
|
||||
$ret = $myMsgParser->ParseMsg($szMsg, $arrArguments);
|
||||
if ( $ret == SUCCESS || $ret == ERROR_MSG_SKIPMESSAGE )
|
||||
return $ret;
|
||||
|
||||
// Extra check, if user wants to, we SKIP the message!
|
||||
if ( $this->_SkipUnparseable == 1 && $ret == ERROR_MSG_NOMATCH )
|
||||
return ERROR_MSG_SKIPMESSAGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,8 @@ class LogStreamDB extends LogStream {
|
||||
*/
|
||||
public function Close()
|
||||
{
|
||||
mysql_close($this->_dbhandle);
|
||||
if ($this->_dbhandle)
|
||||
mysql_close($this->_dbhandle);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@ -131,7 +132,8 @@ class LogStreamDB extends LogStream {
|
||||
// Try to connect to the database
|
||||
if ( $this->_dbhandle == null )
|
||||
{
|
||||
$this->_dbhandle = @mysql_connect($this->_logStreamConfigObj->DBServer,$this->_logStreamConfigObj->DBUser,$this->_logStreamConfigObj->DBPassword);
|
||||
// Forces to open a new link in all cases!
|
||||
$this->_dbhandle = @mysql_connect($this->_logStreamConfigObj->DBServer,$this->_logStreamConfigObj->DBUser,$this->_logStreamConfigObj->DBPassword, true);
|
||||
if (!$this->_dbhandle)
|
||||
{
|
||||
if ( isset($php_errormsg) )
|
||||
@ -208,67 +210,93 @@ class LogStreamDB extends LogStream {
|
||||
public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true)
|
||||
{
|
||||
// Helpers needed for DB Mapping
|
||||
global $content, $gl_starttime;
|
||||
global $dbmapping, $fields;
|
||||
$szTableType = $this->_logStreamConfigObj->DBTableType;
|
||||
|
||||
// define $ret
|
||||
$ret = SUCCESS;
|
||||
|
||||
// No buffer? then read from DB!
|
||||
if ( $this->bufferedRecords == null )
|
||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||
else
|
||||
do
|
||||
{
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
{
|
||||
// We need to load new records, so clear the old ones first!
|
||||
$this->ResetBufferedRecords();
|
||||
|
||||
// Set new Record start, will be used in the SQL Statement!
|
||||
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
|
||||
|
||||
// Now read new ones
|
||||
// No buffer? then read from DB!
|
||||
if ( $this->bufferedRecords == null )
|
||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
$ret = ERROR_NOMORERECORDS;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $ret == SUCCESS )
|
||||
{
|
||||
// Init and set variables
|
||||
foreach ( $this->_arrProperties as $property )
|
||||
else
|
||||
{
|
||||
// Check if mapping exists
|
||||
if ( isset($dbmapping[$szTableType][$property]) )
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
{
|
||||
// Copy property if available!
|
||||
$dbfieldname = $dbmapping[$szTableType][$property];
|
||||
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
|
||||
// We need to load new records, so clear the old ones first!
|
||||
$this->ResetBufferedRecords();
|
||||
|
||||
// Set new Record start, will be used in the SQL Statement!
|
||||
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
|
||||
|
||||
// Now read new ones
|
||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||
|
||||
// Check if we found more records
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
$ret = ERROR_NOMORERECORDS;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $ret == SUCCESS )
|
||||
{
|
||||
// Init and set variables
|
||||
foreach ( $this->_arrProperties as $property )
|
||||
{
|
||||
// Check if mapping exists
|
||||
if ( isset($dbmapping[$szTableType][$property]) )
|
||||
{
|
||||
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date!
|
||||
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] );
|
||||
// Copy property if available!
|
||||
$dbfieldname = $dbmapping[$szTableType][$property];
|
||||
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
|
||||
{
|
||||
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date!
|
||||
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] );
|
||||
else
|
||||
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname];
|
||||
}
|
||||
else
|
||||
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname];
|
||||
$arrProperitesOut[$property] = '';
|
||||
}
|
||||
else
|
||||
$arrProperitesOut[$property] = '';
|
||||
}
|
||||
else
|
||||
$arrProperitesOut[$property] = '';
|
||||
|
||||
// Run optional Message Parsers now
|
||||
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) )
|
||||
{
|
||||
$retParser = $this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut);
|
||||
|
||||
// Check if we have to skip the message!
|
||||
if ( $retParser == ERROR_MSG_SKIPMESSAGE )
|
||||
$ret = $retParser;
|
||||
}
|
||||
|
||||
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
|
||||
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
|
||||
|
||||
// Increment $_currentRecordNum
|
||||
$this->_currentRecordNum++;
|
||||
}
|
||||
|
||||
// Run optional Message Parsers now
|
||||
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) )
|
||||
$this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut);
|
||||
// Check how long we are running. If only two seconds of execution time are left, we abort further reading!
|
||||
$scriptruntime = intval(microtime_float() - $gl_starttime);
|
||||
if ( $scriptruntime > ($content['MaxExecutionTime']-2) )
|
||||
{
|
||||
// This may display a warning message, so the user knows we stopped reading records because of the script timeout.
|
||||
$content['logstream_warning'] = "false";
|
||||
$content['logstream_warning_details'] = $content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'];
|
||||
$content['logstream_warning_code'] = ERROR_FILE_NOMORETIME;
|
||||
|
||||
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
|
||||
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
|
||||
// Return error code
|
||||
return ERROR_FILE_NOMORETIME;
|
||||
}
|
||||
|
||||
// Increment $_currentRecordNum
|
||||
$this->_currentRecordNum++;
|
||||
}
|
||||
// This additional filter check will take care on dynamic fields from the message parser!
|
||||
} while ( $this->ApplyFilters($ret, $arrProperitesOut) != SUCCESS && $ret == SUCCESS );
|
||||
|
||||
// reached here means return result!
|
||||
return $ret;
|
||||
@ -320,24 +348,33 @@ class LogStreamDB extends LogStream {
|
||||
|
||||
while( $bFound == false && $this->ReadNextIDsFromDB() == SUCCESS )
|
||||
{
|
||||
foreach ( $this->bufferedRecords as $myRecord )
|
||||
if ( isset($this->bufferedRecords) )
|
||||
{
|
||||
if ( $myRecord[$uidfieldname] == $uID )
|
||||
foreach ( $this->bufferedRecords as $myRecord )
|
||||
{
|
||||
$bFound = true;
|
||||
$ret = SUCCESS;
|
||||
break; // Break foreach loop!
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpuID = $myRecord[$uidfieldname];
|
||||
// Only Increment $_currentRecordNum
|
||||
$this->_currentRecordNum++;
|
||||
}
|
||||
if ( $myRecord[$uidfieldname] == $uID )
|
||||
{
|
||||
$bFound = true;
|
||||
$ret = SUCCESS;
|
||||
break; // Break foreach loop!
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpuID = $myRecord[$uidfieldname];
|
||||
// Only Increment $_currentRecordNum
|
||||
$this->_currentRecordNum++;
|
||||
}
|
||||
|
||||
// Increment our Pagenumber if needed!
|
||||
if ( $this->_currentRecordNum % $this->_logStreamConfigObj->_pageCount == 0 )
|
||||
$this->_currentPageNumber++;
|
||||
// Increment our Pagenumber if needed!
|
||||
if ( $this->_currentRecordNum % $this->_logStreamConfigObj->_pageCount == 0 )
|
||||
$this->_currentPageNumber++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return error code in this case!
|
||||
$this->ResetBufferedRecords();
|
||||
$ret = ERROR_NOMORERECORDS;
|
||||
}
|
||||
|
||||
if ( $this->_currentPageNumber > 1 && $this->_readDirection == EnumReadDirection::Forward)
|
||||
|
@ -699,215 +699,5 @@ class LogStreamDisk extends LogStream {
|
||||
$this->_p_buffer = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of ApplyFilters in the LogSTreamDisk Class.
|
||||
* This function performs a check on the filters and actually triggers the
|
||||
* syslog parsers as well.
|
||||
*/
|
||||
protected function ApplyFilters($myResults, &$arrProperitesOut)
|
||||
{
|
||||
// IF result was unsuccessfull, return success - nothing we can do here.
|
||||
if ( $myResults >= ERROR )
|
||||
return SUCCESS;
|
||||
|
||||
// Process all filters
|
||||
if ( $this->_filters != null )
|
||||
{
|
||||
// Evaluation default for now is true
|
||||
$bEval = true;
|
||||
|
||||
// Loop through set properties
|
||||
foreach( $arrProperitesOut as $propertyname => $propertyvalue )
|
||||
{
|
||||
// TODO: NOT SURE IF THIS WILL WORK ON NUMBERS AND OTHER TYPES RIGHT NOW
|
||||
if (
|
||||
array_key_exists($propertyname, $this->_filters) &&
|
||||
isset($propertyvalue) /* &&
|
||||
!(is_string($propertyvalue) && strlen($propertyvalue) <= 0) /* Negative because it only matters if the propvalure is a string*/
|
||||
)
|
||||
{
|
||||
// Extra var needed for number checks!
|
||||
$bIsOrFilter = false; // If enabled we need to check for numbereval later
|
||||
$bOrFilter = false;
|
||||
|
||||
// Found something to filter, so do it!
|
||||
foreach( $this->_filters[$propertyname] as $myfilter )
|
||||
{
|
||||
switch( $myfilter[FILTER_TYPE] )
|
||||
{
|
||||
case FILTER_TYPE_STRING:
|
||||
// Only filter if value is non zero
|
||||
if ( strlen($propertyvalue) > 0 && strlen($myfilter[FILTER_VALUE]) > 0 )
|
||||
{
|
||||
// If Syslog message, we have AND handling!
|
||||
if ( $propertyname == SYSLOG_MESSAGE )
|
||||
{
|
||||
// Include Filter
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
|
||||
$bEval = false;
|
||||
}
|
||||
// Exclude Filter
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bEval = false;
|
||||
}
|
||||
}
|
||||
// Otherwise we use OR Handling!
|
||||
else
|
||||
{
|
||||
// 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]) )
|
||||
$bOrFilter = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bOrFilter = true;
|
||||
}
|
||||
}
|
||||
// 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]) )
|
||||
if ( strtolower($propertyvalue) == strtolower($myfilter[FILTER_VALUE]) )
|
||||
$bEval = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false )
|
||||
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
|
||||
$bEval = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Either filter value or property value was empty!
|
||||
// This means we have no match
|
||||
$bEval = false;
|
||||
}
|
||||
|
||||
break;
|
||||
case FILTER_TYPE_NUMBER:
|
||||
$bIsOrFilter = true; // Default is set to TRUE
|
||||
if ( is_numeric($arrProperitesOut[$propertyname]) )
|
||||
{
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE )
|
||||
{
|
||||
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
|
||||
$bOrFilter = true;
|
||||
else
|
||||
$bOrFilter = false;
|
||||
}
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
|
||||
{
|
||||
if ( $myfilter[FILTER_VALUE] == $arrProperitesOut[$propertyname] )
|
||||
$bOrFilter = false;
|
||||
else
|
||||
$bOrFilter = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If wanted, we treat this filter as a success!
|
||||
if ( GetConfigSetting("TreatNotFoundFiltersAsTrue", 0, CFGLEVEL_USER) == 1 )
|
||||
$bOrFilter = true;
|
||||
else
|
||||
$bOrFilter = false;
|
||||
}
|
||||
break;
|
||||
case FILTER_TYPE_DATE:
|
||||
// Get Log TimeStamp
|
||||
$nLogTimeStamp = $arrProperitesOut[$propertyname][EVTIME_TIMESTAMP];
|
||||
|
||||
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
|
||||
{
|
||||
// Get current timestamp
|
||||
$nNowTimeStamp = time();
|
||||
|
||||
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
|
||||
$nLastXTime = 60 * 60; // One Hour!
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
|
||||
$nLastXTime = 60 * 60 * 12; // 12 Hours!
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
|
||||
$nLastXTime = 60 * 60 * 24; // 24 Hours!
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
|
||||
$nLastXTime = 60 * 60 * 24 * 7; // 7 days
|
||||
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
|
||||
$nLastXTime = 60 * 60 * 24 * 31; // 31 days
|
||||
else
|
||||
// WTF default?
|
||||
$nLastXTime = 86400;
|
||||
|
||||
// If Nowtime + LastX is higher then the log timestamp, the this logline is to old for us.
|
||||
if ( ($nNowTimeStamp - $nLastXTime) > $nLogTimeStamp )
|
||||
$bEval = false;
|
||||
}
|
||||
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_FROM )
|
||||
{
|
||||
// Get filter timestamp!
|
||||
$nFromTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
|
||||
|
||||
// If logtime is smaller then FromTime, then the Event is outside of our scope!
|
||||
if ( $nLogTimeStamp < $nFromTimeStamp )
|
||||
$bEval = false;
|
||||
}
|
||||
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_TO )
|
||||
{
|
||||
// Get filter timestamp!
|
||||
// echo $myfilter[FILTER_VALUE];
|
||||
$nToTimeStamp = GetTimeStampFromTimeString($myfilter[FILTER_VALUE]);
|
||||
|
||||
// If logtime is smaller then FromTime, then the Event is outside of our scope!
|
||||
if ( $nLogTimeStamp > $nToTimeStamp )
|
||||
$bEval = false;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
// TODO!
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If was number filter, we apply it the evaluation.
|
||||
if ( $bIsOrFilter )
|
||||
$bEval &= $bOrFilter;
|
||||
|
||||
if ( !$bEval )
|
||||
{
|
||||
// unmatching filter, reset property array
|
||||
foreach ( $this->_arrProperties as $property )
|
||||
$arrProperitesOut[$property] = '';
|
||||
|
||||
// return error!
|
||||
return ERROR_FILTER_NOT_MATCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reached this point means filters did match!
|
||||
return SUCCESS;
|
||||
}
|
||||
else // No filters at all means success!
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -240,69 +240,93 @@ class LogStreamPDO extends LogStream {
|
||||
public function ReadNext(&$uID, &$arrProperitesOut, $bParseMessage = true)
|
||||
{
|
||||
// Helpers needed for DB Mapping
|
||||
global $content, $gl_starttime;
|
||||
global $dbmapping, $fields;
|
||||
$szTableType = $this->_logStreamConfigObj->DBTableType;
|
||||
|
||||
// define $ret
|
||||
$ret = SUCCESS;
|
||||
|
||||
// No buffer? then read from DB!
|
||||
if ( $this->bufferedRecords == null )
|
||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||
else
|
||||
do
|
||||
{
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
{
|
||||
// We need to load new records, so clear the old ones first!
|
||||
$this->ResetBufferedRecords();
|
||||
|
||||
// Set new Record start, will be used in the SQL Statement!
|
||||
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
|
||||
|
||||
// Now read new ones
|
||||
// No buffer? then read from DB!
|
||||
if ( $this->bufferedRecords == null )
|
||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||
//echo "!" . $ret . " " . $this->_currentRecordStart . "=" . $this->_currentRecordNum;
|
||||
|
||||
// Check if we found more records
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
$ret = ERROR_NOMORERECORDS;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $ret == SUCCESS )
|
||||
{
|
||||
// Init and set variables
|
||||
foreach ( $this->_arrProperties as $property )
|
||||
else
|
||||
{
|
||||
// Check if mapping exists
|
||||
if ( isset($dbmapping[$szTableType][$property]) )
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
{
|
||||
// Copy property if available!
|
||||
$dbfieldname = $dbmapping[$szTableType][$property];
|
||||
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
|
||||
// We need to load new records, so clear the old ones first!
|
||||
$this->ResetBufferedRecords();
|
||||
|
||||
// Set new Record start, will be used in the SQL Statement!
|
||||
$this->_currentRecordStart = $this->_currentRecordNum; // + 1;
|
||||
|
||||
// Now read new ones
|
||||
$ret = $this->ReadNextRecordsFromDB($uID);
|
||||
|
||||
// Check if we found more records
|
||||
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
|
||||
$ret = ERROR_NOMORERECORDS;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $ret == SUCCESS )
|
||||
{
|
||||
// Init and set variables
|
||||
foreach ( $this->_arrProperties as $property )
|
||||
{
|
||||
// Check if mapping exists
|
||||
if ( isset($dbmapping[$szTableType][$property]) )
|
||||
{
|
||||
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date!
|
||||
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] );
|
||||
// Copy property if available!
|
||||
$dbfieldname = $dbmapping[$szTableType][$property];
|
||||
if ( isset($this->bufferedRecords[$this->_currentRecordNum][$dbfieldname]) )
|
||||
{
|
||||
if ( isset($fields[$property]['FieldType']) && $fields[$property]['FieldType'] == FILTER_TYPE_DATE ) // Handle as date!
|
||||
$arrProperitesOut[$property] = GetEventTime( $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname] );
|
||||
else
|
||||
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname];
|
||||
}
|
||||
else
|
||||
$arrProperitesOut[$property] = $this->bufferedRecords[$this->_currentRecordNum][$dbfieldname];
|
||||
$arrProperitesOut[$property] = '';
|
||||
}
|
||||
else
|
||||
$arrProperitesOut[$property] = '';
|
||||
}
|
||||
else
|
||||
$arrProperitesOut[$property] = '';
|
||||
|
||||
// Run optional Message Parsers now
|
||||
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) )
|
||||
{
|
||||
$retParser = $this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut);
|
||||
|
||||
// Check if we have to skip the message!
|
||||
if ( $retParser == ERROR_MSG_SKIPMESSAGE )
|
||||
$ret = $retParser;
|
||||
}
|
||||
|
||||
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
|
||||
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
|
||||
|
||||
// Increment $_currentRecordNum
|
||||
$this->_currentRecordNum++;
|
||||
}
|
||||
|
||||
// Run optional Message Parsers now
|
||||
if ( isset($arrProperitesOut[SYSLOG_MESSAGE]) )
|
||||
$this->_logStreamConfigObj->ProcessMsgParsers($arrProperitesOut[SYSLOG_MESSAGE], $arrProperitesOut);
|
||||
// Check how long we are running. If only two seconds of execution time are left, we abort further reading!
|
||||
$scriptruntime = intval(microtime_float() - $gl_starttime);
|
||||
if ( $scriptruntime > ($content['MaxExecutionTime']-2) )
|
||||
{
|
||||
// This may display a warning message, so the user knows we stopped reading records because of the script timeout.
|
||||
$content['logstream_warning'] = "false";
|
||||
$content['logstream_warning_details'] = $content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'];
|
||||
$content['logstream_warning_code'] = ERROR_FILE_NOMORETIME;
|
||||
|
||||
// Set uID to the PropertiesOut! //DEBUG -> $this->_currentRecordNum;
|
||||
$uID = $arrProperitesOut[SYSLOG_UID] = $this->bufferedRecords[$this->_currentRecordNum][$dbmapping[$szTableType][SYSLOG_UID]];
|
||||
// Return error code
|
||||
return ERROR_FILE_NOMORETIME;
|
||||
}
|
||||
|
||||
// Increment $_currentRecordNum
|
||||
$this->_currentRecordNum++;
|
||||
}
|
||||
// This additional filter check will take care on dynamic fields from the message parser!
|
||||
} while ( $this->ApplyFilters($ret, $arrProperitesOut) != SUCCESS && $ret == SUCCESS );
|
||||
|
||||
// reached here means return result!
|
||||
return $ret;
|
||||
|
@ -36,6 +36,7 @@ class MsgParser_wireless extends MsgParser {
|
||||
public $_ClassDescription = 'Custom logfile parser for wireless access points.';
|
||||
public $_ClassHelpArticle = "";
|
||||
public $_ClassRequiredFields = array (
|
||||
"net_host" => array (", ", "FieldID" => "net_host", "FieldDefine" => "SYSLOG_NET_HOST", "FieldCaption" => "Hostname", "FieldType" => 0, "FieldAlign" => "left", "SearchField" => "net_host", "DefaultWidth" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
|
||||
"net_bytesrecieved" => array ( "FieldID" => "net_bytesrecieved", "FieldDefine" => "SYSLOG_NET_BYTESRECIEVED", "FieldCaption" => "Bytes recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytesrecieved", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
|
||||
"net_bytessend" => array (", ", "FieldID" => "net_bytessend", "FieldDefine" => "SYSLOG_NET_BYTESSEND", "FieldCaption" => "Bytes send", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytessend", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0 ),
|
||||
"net_interface" => array (", ", "FieldID" => "net_interface", "FieldDefine" => "SYSLOG_NET_INTERFACE", "FieldCaption" => "Interface", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_interface", "DefaultWidth" => 75, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
|
||||
@ -72,10 +73,71 @@ class MsgParser_wireless extends MsgParser {
|
||||
|
||||
//trim the msg first to remove spaces from begin and end
|
||||
$szMsg = trim($szMsg);
|
||||
//return ERROR_MSG_NOMATCH;
|
||||
|
||||
// Sample: Oct 14 21:05:52 script,info INICIO; Madrid-arturosoria ;wlan1 ;00:1F:3A:66:70:09 ;192.168.10.117 ;24Mbps ;36Mbps ;15:50:56 ;00:00:00.080 ;-80dBm@1Mbps ;21 ;78 ;43351,126437 ;2959,377
|
||||
if ( preg_match('/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?),(.*?) (.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?)$/', $szMsg, $out) )
|
||||
if ( preg_match('/(.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?)$/', $szMsg, $out) )
|
||||
{
|
||||
$arrArguments[SYSLOG_NET_HOST] = trim($out[1]);
|
||||
|
||||
// Set wlan log specific properties!
|
||||
$arrArguments[SYSLOG_NET_INTERFACE] = trim($out[2]);
|
||||
$arrArguments[SYSLOG_NET_MAC_ADDRESS] = trim($out[3]);
|
||||
$arrArguments[SYSLOG_NET_LASTIP] = trim($out[4]);
|
||||
$arrArguments[SYSLOG_NET_RXRATE] = trim($out[5]);
|
||||
$arrArguments[SYSLOG_NET_TXRATE] = trim($out[6]);
|
||||
$arrArguments[SYSLOG_NET_UPTIME] = trim($out[7]);
|
||||
$arrArguments[SYSLOG_NET_LASTACTIVITY] = trim($out[8]);
|
||||
$arrArguments[SYSLOG_NET_SIGNALSTRENGTH]= trim($out[9]);
|
||||
|
||||
// Number based fields
|
||||
$arrArguments[SYSLOG_NET_SIGNALTONOISE] = trim($out[10]);
|
||||
$arrArguments[SYSLOG_NET_TXCCQ] = trim($out[11]);
|
||||
|
||||
// Set msg to whole logline
|
||||
$arrArguments[SYSLOG_MESSAGE] = trim($out[0]);
|
||||
|
||||
// Get additional parameters!
|
||||
if ( preg_match('/(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?);(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?)$/', $out[12], $out2) )
|
||||
{
|
||||
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = trim($out2[1]);
|
||||
$arrArguments[SYSLOG_NET_BYTESSEND] = trim($out2[2]);
|
||||
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = trim($out2[3]);
|
||||
$arrArguments[SYSLOG_NET_PACKETSSEND] = trim($out2[4]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = "";
|
||||
$arrArguments[SYSLOG_NET_BYTESSEND] = "";
|
||||
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = "";
|
||||
$arrArguments[SYSLOG_NET_PACKETSSEND] = "";
|
||||
}
|
||||
|
||||
if ( $this->_MsgNormalize == 1 )
|
||||
{
|
||||
//Init tmp msg
|
||||
$szTmpMsg = "";
|
||||
|
||||
// Create Field Array to prepend into msg! Reverse Order here
|
||||
$myFields = array( SYSLOG_NET_PACKETSSEND, SYSLOG_NET_PACKETSRECIEVED, SYSLOG_NET_BYTESSEND, SYSLOG_NET_BYTESRECIEVED, SYSLOG_NET_TXCCQ, SYSLOG_NET_SIGNALTONOISE, SYSLOG_NET_UPTIME, SYSLOG_NET_SIGNALSTRENGTH, SYSLOG_NET_LASTACTIVITY, SYSLOG_NET_TXRATE, SYSLOG_NET_RXRATE, SYSLOG_NET_LASTIP, SYSLOG_NET_MAC_ADDRESS, SYSLOG_NET_INTERFACE, SYSLOG_HOST );
|
||||
|
||||
foreach ( $myFields as $myField )
|
||||
{
|
||||
// Set Field Caption
|
||||
if ( isset($fields[$myField]['FieldCaption']) )
|
||||
$szFieldName = $fields[$myField]['FieldCaption'];
|
||||
else
|
||||
$szFieldName = $myField;
|
||||
|
||||
// Append Field into msg
|
||||
$szTmpMsg = $szFieldName . ": '" . $arrArguments[$myField] . "'\n" . $szTmpMsg;
|
||||
}
|
||||
|
||||
// copy finished MSG back!
|
||||
$arrArguments[SYSLOG_MESSAGE] = $szTmpMsg;
|
||||
}
|
||||
}
|
||||
// Sample: Madrid-arturosoria ;wlan1 ;00:1F:3A:66:70:09 ;192.168.10.117 ;24Mbps ;36Mbps ;15:50:56 ;00:00:00.080 ;-80dBm@1Mbps ;21 ;78 ;43351,126437 ;2959,377
|
||||
else if ( preg_match('/(...)(?:.|..)([0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?),(.*?) (.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?);(.|.*?)$/', $szMsg, $out) )
|
||||
{
|
||||
|
||||
//print_r ( $out );
|
||||
@ -83,33 +145,32 @@ class MsgParser_wireless extends MsgParser {
|
||||
|
||||
// Set generic properties
|
||||
$arrArguments[SYSLOG_DATE] = GetEventTime($out[1] . " " . $out[2]);
|
||||
$arrArguments[SYSLOG_HOST] = $out[6];
|
||||
// $arrArguments[SYSLOG_DATE] = GetEventTime($out[4]);
|
||||
$arrArguments[SYSLOG_NET_HOST] = trim($out[6]);
|
||||
|
||||
// Set wlan log specific properties!
|
||||
$arrArguments[SYSLOG_NET_INTERFACE] = trim($out[7]);
|
||||
$arrArguments[SYSLOG_NET_MAC_ADDRESS] = trim($out[8]);
|
||||
$arrArguments[SYSLOG_NET_LASTIP] = trim($out[9]);
|
||||
$arrArguments[SYSLOG_NET_RXRATE] = trim($out[10]);
|
||||
$arrArguments[SYSLOG_NET_TXRATE] = trim($out[11]);
|
||||
$arrArguments[SYSLOG_NET_UPTIME] = trim($out[12]);
|
||||
$arrArguments[SYSLOG_NET_LASTACTIVITY] = trim($out[13]);
|
||||
$arrArguments[SYSLOG_NET_SIGNALSTRENGTH] = trim($out[14]);
|
||||
$arrArguments[SYSLOG_NET_INTERFACE] = trim($out[7]);
|
||||
$arrArguments[SYSLOG_NET_MAC_ADDRESS] = trim($out[8]);
|
||||
$arrArguments[SYSLOG_NET_LASTIP] = trim($out[9]);
|
||||
$arrArguments[SYSLOG_NET_RXRATE] = trim($out[10]);
|
||||
$arrArguments[SYSLOG_NET_TXRATE] = trim($out[11]);
|
||||
$arrArguments[SYSLOG_NET_UPTIME] = trim($out[12]);
|
||||
$arrArguments[SYSLOG_NET_LASTACTIVITY] = trim($out[13]);
|
||||
$arrArguments[SYSLOG_NET_SIGNALSTRENGTH]= trim($out[14]);
|
||||
|
||||
// Number based fields
|
||||
$arrArguments[SYSLOG_NET_SIGNALTONOISE] = $out[15];
|
||||
$arrArguments[SYSLOG_NET_TXCCQ] = $out[16];
|
||||
$arrArguments[SYSLOG_NET_SIGNALTONOISE] = trim($out[15]);
|
||||
$arrArguments[SYSLOG_NET_TXCCQ] = trim($out[16]);
|
||||
|
||||
// Set msg to whole logline
|
||||
$arrArguments[SYSLOG_MESSAGE] = $out[0];
|
||||
$arrArguments[SYSLOG_MESSAGE] = trim($out[0]);
|
||||
|
||||
// Get additional parameters!
|
||||
if ( preg_match('/(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?);(.|.*?[0-9]{1,12}.*?),(.|.*?[0-9]{1,12}.*?)$/', $out[17], $out2) )
|
||||
{
|
||||
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = $out2[1];
|
||||
$arrArguments[SYSLOG_NET_BYTESSEND] = $out2[2];
|
||||
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = $out2[3];
|
||||
$arrArguments[SYSLOG_NET_PACKETSSEND] = $out2[4];
|
||||
$arrArguments[SYSLOG_NET_BYTESRECIEVED] = trim($out2[1]);
|
||||
$arrArguments[SYSLOG_NET_BYTESSEND] = trim($out2[2]);
|
||||
$arrArguments[SYSLOG_NET_PACKETSRECIEVED] = trim($out2[3]);
|
||||
$arrArguments[SYSLOG_NET_PACKETSSEND] = trim($out2[4]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ else if ( $content['CONVERT_STEP'] == 3 )
|
||||
}
|
||||
|
||||
// Append INSERT Statement for Config Table to set the Database Version ^^!
|
||||
$mycommands[count($mycommands)] = "INSERT INTO `" . GetConfigSetting("UserDBPref") . "config` (`propname`, `propvalue`, `is_global`) VALUES ('database_installedversion', '" . $content['database_internalversion'] . "', " . $content['database_internalversion'] . ")";
|
||||
$mycommands[count($mycommands)] = "INSERT INTO `" . GetConfigSetting("UserDBPref") . "config` (`propname`, `propvalue`, `is_global`) VALUES ('database_installedversion', '" . $content['database_internalversion'] . "', 1)";
|
||||
|
||||
// --- Now execute all commands
|
||||
ini_set('error_reporting', E_WARNING); // Enable Warnings!
|
||||
@ -211,7 +211,7 @@ else if ( $content['CONVERT_STEP'] == 4 )
|
||||
if ( isset($_GET['errormsg']) )
|
||||
{
|
||||
$content['iserror'] = "true";
|
||||
$content['errormsg'] = DB_RemoveBadChars( urldecode($_GET['errormsg']) );
|
||||
$content['errormsg'] = DB_StripSlahes( urldecode($_GET['errormsg']) );
|
||||
}
|
||||
}
|
||||
else if ( $content['CONVERT_STEP'] == 5 )
|
||||
|
5
src/include/db_update_v0.txt
Normal file
5
src/include/db_update_v0.txt
Normal file
@ -0,0 +1,5 @@
|
||||
-- New Database Structure Updates
|
||||
|
||||
-- Insert data
|
||||
|
||||
-- Updated Data
|
5
src/include/db_update_v1.txt
Normal file
5
src/include/db_update_v1.txt
Normal file
@ -0,0 +1,5 @@
|
||||
-- New Database Structure Updates
|
||||
|
||||
-- Insert data
|
||||
|
||||
-- Updated Data
|
7
src/include/db_update_v7.txt
Normal file
7
src/include/db_update_v7.txt
Normal file
@ -0,0 +1,7 @@
|
||||
-- New Database Structure Updates
|
||||
ALTER TABLE `logcon_sources` ADD `MsgSkipUnparseable` BOOL NOT NULL DEFAULT '0' AFTER `MsgNormalize` ;
|
||||
ALTER TABLE `logcon_sources` ADD `DBRecordsPerQuery` INT NOT NULL DEFAULT '100' AFTER `DBEnableRowCounting` ;
|
||||
|
||||
-- Insert data
|
||||
|
||||
-- Updated Data
|
@ -892,14 +892,14 @@ function DieWithErrorMsg( $szerrmsg )
|
||||
echo
|
||||
"<html><title>phpLogCon :: Critical Error occured</title><head>" .
|
||||
"<link rel=\"stylesheet\" href=\"" . $gl_root_path . "themes/default/main.css\" type=\"text/css\"></head><body><br><br>" .
|
||||
"<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\"><tr>".
|
||||
"<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\" cellpadding=\"2\"><tr>".
|
||||
"<td class=\"PriorityError\" align=\"center\" colspan=\"2\">" .
|
||||
"<H3>Critical Error occured</H3>" .
|
||||
"</td></tr>" .
|
||||
"<tr><td class=\"cellmenu1\" align=\"left\">Errordetails:</td>" .
|
||||
"<td class=\"tableBackground\" align=\"left\">" .
|
||||
"<tr><td class=\"cellmenu1_naked\" align=\"left\">Errordetails:</td>" .
|
||||
"<td class=\"tableBackground\" align=\"left\"><br>" .
|
||||
$szerrmsg .
|
||||
"</td></tr></table>" .
|
||||
"<br><br></td></tr></table>" .
|
||||
"</body></html>";
|
||||
exit;
|
||||
}
|
||||
@ -910,14 +910,14 @@ function DieWithFriendlyErrorMsg( $szerrmsg )
|
||||
echo
|
||||
"<html><title>phpLogCon :: Error occured</title><head>" .
|
||||
"<link rel=\"stylesheet\" href=\"" . $gl_root_path . "themes/default/main.css\" type=\"text/css\"></head><body><br><br>" .
|
||||
"<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\"><tr>".
|
||||
"<table width=\"600\" align=\"center\" class=\"with_border_alternate ErrorMsg\" cellpadding=\"2\"><tr>".
|
||||
"<td class=\"PriorityWarning\" align=\"center\" colspan=\"2\">" .
|
||||
"<H3>Error occured</H3>" .
|
||||
"</td></tr>" .
|
||||
"<tr><td class=\"cellmenu1\" align=\"left\">Errordetails:</td>" .
|
||||
"<td class=\"tableBackground\" align=\"left\">" .
|
||||
"<tr><td class=\"cellmenu1_naked\" align=\"left\">Errordetails:</td>" .
|
||||
"<td class=\"tableBackground\" align=\"left\"><br>" .
|
||||
$szerrmsg .
|
||||
"</td></tr></table>" .
|
||||
"<br><br></td></tr></table>" .
|
||||
"</body></html>";
|
||||
exit;
|
||||
}
|
||||
@ -1005,6 +1005,12 @@ function RedirectPage( $newpage )
|
||||
|
||||
function RedirectResult( $szMsg, $newpage )
|
||||
{
|
||||
global $content;
|
||||
|
||||
if ( defined('PHPLOGCON_INERROR') )
|
||||
DieWithErrorMsg( GetAndReplaceLangStr($content["LN_ERROR_REDIRECTABORTED"], $newpage) );
|
||||
|
||||
// Perform redirect!
|
||||
header("Location: result.php?msg=" . urlencode($szMsg) . "&redir=" . urlencode($newpage));
|
||||
exit;
|
||||
}
|
||||
@ -1341,44 +1347,44 @@ function PrintSecureUserCheck( $warningtext, $yesmsg, $nomsg )
|
||||
exit;
|
||||
}
|
||||
|
||||
function SaveGeneralSettingsIntoDB()
|
||||
function SaveGeneralSettingsIntoDB($bForceStripSlahes = false)
|
||||
{
|
||||
WriteConfigValue( "ViewDefaultLanguage", true );
|
||||
WriteConfigValue( "ViewDefaultTheme", true );
|
||||
WriteConfigValue( "ViewDefaultLanguage", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "ViewDefaultTheme", true, null, null,$bForceStripSlahes );
|
||||
|
||||
WriteConfigValue( "ViewUseTodayYesterday", true );
|
||||
WriteConfigValue( "ViewEnableDetailPopups", true );
|
||||
WriteConfigValue( "EnableIPAddressResolve", true );
|
||||
WriteConfigValue( "MiscShowDebugMsg", true );
|
||||
WriteConfigValue( "MiscShowDebugGridCounter", true );
|
||||
WriteConfigValue( "MiscShowPageRenderStats", true );
|
||||
WriteConfigValue( "MiscEnableGzipCompression", true );
|
||||
WriteConfigValue( "SuppressDuplicatedMessages", true );
|
||||
WriteConfigValue( "TreatNotFoundFiltersAsTrue", true );
|
||||
WriteConfigValue( "ViewUseTodayYesterday", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "ViewEnableDetailPopups", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "EnableIPAddressResolve", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "MiscShowDebugMsg", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "MiscShowDebugGridCounter", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "MiscShowPageRenderStats", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "MiscEnableGzipCompression", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "SuppressDuplicatedMessages", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "TreatNotFoundFiltersAsTrue", true, null, null,$bForceStripSlahes );
|
||||
|
||||
WriteConfigValue( "ViewMessageCharacterLimit", true );
|
||||
WriteConfigValue( "ViewStringCharacterLimit", true );
|
||||
WriteConfigValue( "ViewEntriesPerPage", true );
|
||||
WriteConfigValue( "ViewEnableAutoReloadSeconds", true );
|
||||
WriteConfigValue( "PopupMenuTimeout", true );
|
||||
WriteConfigValue( "ViewMessageCharacterLimit", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "ViewStringCharacterLimit", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "ViewEntriesPerPage", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "ViewEnableAutoReloadSeconds", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "PopupMenuTimeout", true, null, null,$bForceStripSlahes );
|
||||
|
||||
WriteConfigValue( "PrependTitle", true );
|
||||
WriteConfigValue( "SearchCustomButtonCaption", true );
|
||||
WriteConfigValue( "SearchCustomButtonSearch", true );
|
||||
WriteConfigValue( "PrependTitle", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "SearchCustomButtonCaption", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "SearchCustomButtonSearch", true, null, null,$bForceStripSlahes );
|
||||
|
||||
// Extra Fields
|
||||
WriteConfigValue( "DefaultViewsID", true );
|
||||
WriteConfigValue( "DefaultSourceID", true );
|
||||
WriteConfigValue( "DefaultViewsID", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "DefaultSourceID", true, null, null,$bForceStripSlahes );
|
||||
|
||||
// GLOBAL ONLY
|
||||
WriteConfigValue( "DebugUserLogin", true );
|
||||
WriteConfigValue( "MiscDebugToSyslog", true );
|
||||
WriteConfigValue( "MiscMaxExecutionTime", true );
|
||||
WriteConfigValue( "DebugUserLogin", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "MiscDebugToSyslog", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "MiscMaxExecutionTime", true, null, null,$bForceStripSlahes );
|
||||
|
||||
// Custom HTML Code
|
||||
WriteConfigValue( "InjectHtmlHeader", true );
|
||||
WriteConfigValue( "InjectBodyHeader", true );
|
||||
WriteConfigValue( "InjectBodyFooter", true );
|
||||
WriteConfigValue( "InjectHtmlHeader", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "InjectBodyHeader", true, null, null,$bForceStripSlahes );
|
||||
WriteConfigValue( "InjectBodyFooter", true, null, null ,$bForceStripSlahes );
|
||||
}
|
||||
|
||||
function SaveUserGeneralSettingsIntoDB()
|
||||
@ -1507,6 +1513,22 @@ function list_files($directory, $failOnError = true)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to flush html output to avoid redirects if errors happen!
|
||||
*/
|
||||
function FlushHtmlOutput()
|
||||
{
|
||||
global $RUNMODE;
|
||||
|
||||
// not needed in console mode
|
||||
if ( $RUNMODE == RUNMODE_COMMANDLINE )
|
||||
return;
|
||||
|
||||
//Flush php output
|
||||
@flush();
|
||||
@ob_flush();
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to get the errorCode
|
||||
*/
|
||||
|
@ -80,6 +80,12 @@ function InitSource(&$mysource)
|
||||
$content['Sources'][$iSourceID]['MsgNormalize'] = 0;
|
||||
}
|
||||
|
||||
if ( !isset($mysource['MsgSkipUnparseable']) )
|
||||
{
|
||||
$CFG['Sources'][$iSourceID]['MsgSkipUnparseable'] = 0;
|
||||
$content['Sources'][$iSourceID]['MsgSkipUnparseable'] = 0;
|
||||
}
|
||||
|
||||
if ( !isset($mysource['Description']) )
|
||||
{
|
||||
$CFG['Sources'][$iSourceID]['Description'] = "";
|
||||
@ -153,6 +159,7 @@ function InitSource(&$mysource)
|
||||
if ( isset($mysource['DBUser']) ) { $mysource['ObjRef']->DBUser = $mysource['DBUser']; }
|
||||
if ( isset($mysource['DBPassword']) ) { $mysource['ObjRef']->DBPassword = $mysource['DBPassword']; }
|
||||
if ( isset($mysource['DBEnableRowCounting']) ) { $mysource['ObjRef']->DBEnableRowCounting = $mysource['DBEnableRowCounting']; }
|
||||
if ( isset($mysource['DBRecordsPerQuery']) ) { $mysource['ObjRef']->RecordsPerQuery = $mysource['DBRecordsPerQuery']; }
|
||||
}
|
||||
else if ( $mysource['SourceType'] == SOURCE_PDO )
|
||||
{
|
||||
@ -185,6 +192,7 @@ function InitSource(&$mysource)
|
||||
$mysource['ObjRef']->_pageCount = GetConfigSetting("ViewEntriesPerPage", 50);
|
||||
$mysource['ObjRef']->SetMsgParserList( $mysource['MsgParserList'] );
|
||||
$mysource['ObjRef']->SetMsgNormalize( $mysource['MsgNormalize'] );
|
||||
$mysource['ObjRef']->SetSkipUnparseable( $mysource['MsgSkipUnparseable'] );
|
||||
|
||||
// Set default SourceID here!
|
||||
if ( isset($content['Sources'][$iSourceID]) && !isset($currentSourceID) )
|
||||
|
@ -45,7 +45,7 @@ $errdesc = "";
|
||||
$errno = 0;
|
||||
|
||||
// --- Current Database Version, this is important for automated database Updates!
|
||||
$content['database_internalversion'] = "6"; // Whenever incremented, a database upgrade is needed
|
||||
$content['database_internalversion'] = "7"; // Whenever incremented, a database upgrade is needed
|
||||
$content['database_installedversion'] = "0"; // 0 is default which means Prior Versioning Database
|
||||
// ---
|
||||
|
||||
@ -216,6 +216,9 @@ function DB_PrintError($MyErrorMsg, $DieOrNot)
|
||||
$errdesc = mysql_error();
|
||||
$errno = mysql_errno();
|
||||
|
||||
// Define global variable so we know an error has occured!
|
||||
define('PHPLOGCON_INERROR', true);
|
||||
|
||||
$errormsg="Database error: $MyErrorMsg $linesep";
|
||||
$errormsg.="mysql error: $errdesc $linesep";
|
||||
$errormsg.="mysql error number: $errno $linesep";
|
||||
@ -236,17 +239,18 @@ function DB_RemoveParserSpecialBadChars($myString)
|
||||
return $returnstr;
|
||||
}
|
||||
|
||||
function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL)
|
||||
function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL, $bForceStripSlahes = false)
|
||||
{
|
||||
if ( $dbEngine == DB_MSSQL )
|
||||
{
|
||||
//TODO STRIP SLASHES ?!
|
||||
// MSSQL needs special treatment -.-
|
||||
return str_replace("'","''",$myString);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Replace with internal PHP Functions!
|
||||
if ( !get_magic_quotes_gpc() )
|
||||
if ( !get_magic_quotes_gpc() || $bForceStripSlahes )
|
||||
return addslashes($myString);
|
||||
// return addcslashes($myString, "'");
|
||||
else
|
||||
@ -263,7 +267,7 @@ function DB_RemoveBadChars($myString, $dbEngine = DB_MYSQL)
|
||||
function DB_StripSlahes($myString)
|
||||
{
|
||||
// Replace with internal PHP Functions!
|
||||
if ( !get_magic_quotes_gpc() )
|
||||
if ( get_magic_quotes_gpc() )
|
||||
return stripslashes($myString);
|
||||
else
|
||||
return $myString;
|
||||
@ -319,17 +323,13 @@ function DB_Exec($query)
|
||||
return false;
|
||||
}
|
||||
|
||||
function PrepareValueForDB($szValue)
|
||||
function PrepareValueForDB($szValue, $bForceStripSlahes = false)
|
||||
{
|
||||
//echo "<br>" . $szValue . "<br>!" . preg_match("/[^\\\\]['\\\\][^'\\\\]/e", $szValue, $matches) . "<br>";
|
||||
// Copy value for DB and check for BadDB Chars!
|
||||
// if ( preg_match("/(?<!\\\\)\'|\\\\\\\\/x", $szValue) ) /* OLD /(?<!\\\\)\'|(?<!\\\\)\\\\/e */
|
||||
return DB_RemoveBadChars($szValue);
|
||||
// else
|
||||
// return $szValue;
|
||||
// Wrapper for this function
|
||||
return DB_RemoveBadChars($szValue, null, $bForceStripSlahes);
|
||||
}
|
||||
|
||||
function WriteConfigValue($szPropName, $is_global = true, $userid = false, $groupid = false)
|
||||
function WriteConfigValue($szPropName, $is_global = true, $userid = false, $groupid = false, $bForceStripSlahes = false)
|
||||
{
|
||||
global $content;
|
||||
|
||||
@ -343,7 +343,7 @@ function WriteConfigValue($szPropName, $is_global = true, $userid = false, $grou
|
||||
if ( isset($content[$szPropName]) )
|
||||
{
|
||||
// Copy value for DB and check for BadDB Chars!
|
||||
$szDbValue = PrepareValueForDB( $content[$szPropName] );
|
||||
$szDbValue = PrepareValueForDB( $content[$szPropName], $bForceStripSlahes );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -384,7 +384,7 @@ function WriteConfigValue($szPropName, $is_global = true, $userid = false, $grou
|
||||
if ( isset($USERCFG[$szPropName]) )
|
||||
{
|
||||
// Copy value for DB and check for BadDB Chars!
|
||||
$szDbValue = PrepareValueForDB( $USERCFG[$szPropName] );
|
||||
$szDbValue = PrepareValueForDB( $USERCFG[$szPropName], $bForceStripSlahes );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ function ConvertGeneralSettings()
|
||||
global $content;
|
||||
|
||||
// Only call the same function as in admin index!
|
||||
SaveGeneralSettingsIntoDB();
|
||||
SaveGeneralSettingsIntoDB(true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -267,7 +267,17 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ( $ret == ERROR_MSG_SKIPMESSAGE )
|
||||
{
|
||||
do
|
||||
{
|
||||
// Skip until we find a suitable entry
|
||||
$ret = $stream->ReadNext($uID, $logArray);
|
||||
} while ($ret == ERROR_MSG_SKIPMESSAGE);
|
||||
}
|
||||
|
||||
// check for error return state!
|
||||
if ( $ret != SUCCESS )
|
||||
{
|
||||
// This will disable to Main SyslogView and show an error message
|
||||
$content['syslogmessagesenabled'] = "false";
|
||||
@ -625,7 +635,14 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
|
||||
// Increment Counter
|
||||
$counter++;
|
||||
} while ($counter < $content['CurrentViewEntriesPerPage'] && ($ret = $stream->ReadNext($uID, $logArray)) == SUCCESS);
|
||||
|
||||
// --- Extra Loop to get the next entry!
|
||||
do
|
||||
{
|
||||
$ret = $stream->ReadNext($uID, $logArray);
|
||||
} while ( $ret == ERROR_MSG_SKIPMESSAGE );
|
||||
// ---
|
||||
} while ( $counter < $content['CurrentViewEntriesPerPage'] && ($ret == SUCCESS) );
|
||||
//print_r ( $content['syslogmessages'] );
|
||||
|
||||
// Move below processing - Read First and LAST UID's before start reading the stream!
|
||||
|
@ -260,7 +260,7 @@ else if ( $content['INSTALL_STEP'] == 3 )
|
||||
if ( isset($_GET['errormsg']) )
|
||||
{
|
||||
$content['iserror'] = "true";
|
||||
$content['errormsg'] = urldecode($_GET['errormsg']);
|
||||
$content['errormsg'] = urldecode( DB_StripSlahes($_GET['errormsg']) );
|
||||
}
|
||||
}
|
||||
else if ( $content['INSTALL_STEP'] == 4 )
|
||||
@ -461,7 +461,7 @@ else if ( $content['INSTALL_STEP'] == 6 )
|
||||
if ( isset($_GET['errormsg']) )
|
||||
{
|
||||
$content['iserror'] = "true";
|
||||
$content['errormsg'] = urldecode($_GET['errormsg']);
|
||||
$content['errormsg'] = urldecode( DB_StripSlahes($_GET['errormsg']) );
|
||||
}
|
||||
}
|
||||
else // NO Database means NO user management, so next step!
|
||||
@ -553,7 +553,7 @@ else if ( $content['INSTALL_STEP'] == 7 )
|
||||
if ( isset($_GET['errormsg']) )
|
||||
{
|
||||
$content['iserror'] = "true";
|
||||
$content['errormsg'] = urldecode($_GET['errormsg']);
|
||||
$content['errormsg'] = urldecode( DB_StripSlahes($_GET['errormsg']) );
|
||||
}
|
||||
}
|
||||
else if ( $content['INSTALL_STEP'] == 8 )
|
||||
|
@ -223,6 +223,7 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
|
||||
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
|
||||
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
|
||||
$content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)";
|
||||
$content['LN_SOURCES_ERROR_INVALIDVALUE'] = "Invalid value for the paramater '%1'.";
|
||||
|
||||
// Database Upgrade
|
||||
$content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update";
|
||||
|
@ -97,6 +97,7 @@ $content['LN_ERROR_NORECORDS'] = "Es wurden keine syslog-Einträge gefunden.
|
||||
$content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'] = "While reading the logstream, the php script timeout forced me to abort at this point.<br><br> If you want to avoid this, please increase the phpLogCon script timeout in your config.php. If the user system is installed, you can do that in Admin center.";
|
||||
$content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required";
|
||||
$content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available.";
|
||||
$content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the <a href="%1">page</a> was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.';
|
||||
|
||||
// Topmenu Entries
|
||||
$content['LN_MENU_SEARCH'] = "Suchen";
|
||||
@ -191,6 +192,8 @@ $content['LN_CFG_FIRSTSYSLOGSOURCE'] = "Erste Syslog Quelle";
|
||||
$content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in";
|
||||
$content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)";
|
||||
$content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers";
|
||||
$content['LN_CFG_SKIPUNPARSEABLE'] = "Skip unparseable messages (Only works if msgparsers are configured!)";
|
||||
$content['LN_CFG_DBRECORDSPERQUERY'] = "Recordcount for database queries";
|
||||
|
||||
// Details page
|
||||
$content['LN_DETAILS_FORSYSLOGMSG'] = "Details für syslog-Nachrichten mit der ID";
|
||||
|
@ -227,6 +227,7 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
|
||||
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
|
||||
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
|
||||
$content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)";
|
||||
$content['LN_SOURCES_ERROR_INVALIDVALUE'] = "Invalid value for the paramater '%1'.";
|
||||
|
||||
// Database Upgrade
|
||||
$content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update";
|
||||
|
@ -99,6 +99,7 @@ $content['LN_ERROR_DB_DBFIELDNOTFOUND'] = "Database Field mapping for at least o
|
||||
$content['LN_ERROR_FILE_NOMORETIME'] = "No more time for processing left";
|
||||
$content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required";
|
||||
$content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available.";
|
||||
$content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the <a href="%1">page</a> was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.';
|
||||
|
||||
// Topmenu Entries
|
||||
$content['LN_MENU_SEARCH'] = "Search";
|
||||
@ -193,6 +194,8 @@ $content['LN_CFG_VIEW'] = "Select View";
|
||||
$content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in";
|
||||
$content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)";
|
||||
$content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers";
|
||||
$content['LN_CFG_SKIPUNPARSEABLE'] = "Skip unparseable messages (Only works if msgparsers are configured!)";
|
||||
$content['LN_CFG_DBRECORDSPERQUERY'] = "Recordcount for database queries";
|
||||
|
||||
// Details page
|
||||
$content['LN_DETAILS_FORSYSLOGMSG'] = "Details for the syslog messages with id";
|
||||
|
@ -223,6 +223,7 @@ $content['LN_SOURCES_WARNDELETESEARCH'] = "Are you sure that you want to delete
|
||||
$content['LN_SOURCES_ERROR_DELSOURCE'] = "Deleting of the Source with id '%1' failed!";
|
||||
$content['LN_SOURCES_ERROR_HASBEENDEL'] = "The Source '%1' has been successfully deleted!";
|
||||
$content['LN_SOURCES_DESCRIPTION'] = "Source Description (Optional)";
|
||||
$content['LN_SOURCES_ERROR_INVALIDVALUE'] = "Invalid value for the paramater '%1'.";
|
||||
|
||||
// Database Upgrade
|
||||
$content['LN_DBUPGRADE_TITLE'] = "phpLogCon Database Update";
|
||||
|
@ -101,6 +101,7 @@ $content['LN_ERROR_NORECORDS'] = "Sem mensagens encontradas.";
|
||||
$content['LN_WARNING_LOGSTREAMDISK_TIMEOUT'] = "While reading the logstream, the php script timeout forced me to abort at this point.<br><br> If you want to avoid this, please increase the phpLogCon script timeout in your config.php. If the user system is installed, you can do that in Admin center.";
|
||||
$content['LN_WARNING_DBUPGRADE'] = "Database Upgrade required";
|
||||
$content['LN_WARNING_DBUPGRADE_TEXT'] = "The current installed database version is '%1'.<br>An update to version '%2' is available.";
|
||||
$content['LN_ERROR_REDIRECTABORTED'] = 'Automatic redirect to the <a href="%1">page</a> was aborted, as an internal error occured. Please see the error details above and contact our support forums if you need assistance.';
|
||||
|
||||
// Topmenu Entries
|
||||
$content['LN_MENU_SEARCH'] = "Search";
|
||||
@ -195,6 +196,8 @@ $content['LN_CFG_VIEW'] = "Selecione visão";
|
||||
$content['LN_CFG_DBUSERLOGINREQUIRED'] = "Require user to be logged in";
|
||||
$content['LN_CFG_MSGPARSERS'] = "Message Parsers (comma seperated)";
|
||||
$content['LN_CFG_NORMALIZEMSG'] = "Normalize Message within Parsers";
|
||||
$content['LN_CFG_SKIPUNPARSEABLE'] = "Skip unparseable messages (Only works if msgparsers are configured!)";
|
||||
$content['LN_CFG_DBRECORDSPERQUERY'] = "Recordcount for database queries";
|
||||
|
||||
// Details page
|
||||
$content['LN_DETAILS_FORSYSLOGMSG'] = "Detalhes para a mensagem com id";
|
||||
|
@ -73,7 +73,7 @@
|
||||
<td align="right" class="line1" width="350"><input type="text" name="DisplayName" size="55" maxlength="255" value="{DisplayName}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>
|
||||
<td align="left" class="cellmenu2"><b>{LN_SEARCH_QUERY}</b></td>
|
||||
<td align="right" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value="{SearchQuery}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -17,14 +17,16 @@
|
||||
showvisibility("HiddenDatabaseTypeOptions");
|
||||
hidevisibility("HiddenDiskTypeOptions");
|
||||
|
||||
hidevisibility("HiddenDBTypesOptions");
|
||||
showvisibility("HiddenMYSQLSourceOptions");
|
||||
hidevisibility("HiddenPDOSourceOptions");
|
||||
}
|
||||
else if (myfield.value == 3)
|
||||
{
|
||||
showvisibility("HiddenDatabaseTypeOptions");
|
||||
hidevisibility("HiddenDiskTypeOptions");
|
||||
|
||||
showvisibility("HiddenDBTypesOptions");
|
||||
showvisibility("HiddenPDOSourceOptions");
|
||||
hidevisibility("HiddenMYSQLSourceOptions");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -135,6 +137,10 @@
|
||||
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_NORMALIZEMSG}</b></td>
|
||||
<td align="right" class="line1"><input type="checkbox" name="MsgNormalize" value="1" {CHECKED_ISNORMALIZEMSG}></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2_naked"><b>{LN_CFG_SKIPUNPARSEABLE}</b></td>
|
||||
<td align="right" class="line1"><input type="checkbox" name="MsgSkipUnparseable" value="1" {CHECKED_ISSKIPUNPARSEABLE}></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>
|
||||
@ -180,7 +186,7 @@
|
||||
<tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_CFG_DATABASETYPEOPTIONS}</b></td></tr>
|
||||
</table>
|
||||
|
||||
<div id="HiddenDBTypesOptions" class="ShownContent">
|
||||
<div id="HiddenPDOSourceOptions" class="ShownContent">
|
||||
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBSTORAGEENGINE}</b></td>
|
||||
@ -229,6 +235,15 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="HiddenMYSQLSourceOptions" class="ShownContent">
|
||||
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBRECORDSPERQUERY}</b></td>
|
||||
<td align="right" class="line1" width="350"><input type="text" name="SourceDBRecordsPerQuery" size="40" maxlength="255" value="{SourceDBRecordsPerQuery}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
|
@ -27,7 +27,7 @@
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0" align="center" class="with_border_alternate">
|
||||
<tr>
|
||||
<td class="title">
|
||||
<h1 align="center">{LN_CONVERT_TITLETOP}</h1>
|
||||
<h3 align="center">{LN_CONVERT_TITLETOP}</h3>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -56,7 +56,7 @@
|
||||
<table width="100%" cellpadding="2" cellspacing="1" border="0" align="center" class="with_border_alternate">
|
||||
<tr>
|
||||
<td class="title">
|
||||
<h1 align="center">{INSTALL_TITLETOP}</h1>
|
||||
<h3 align="center">{INSTALL_TITLETOP}</h3>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Loading…
x
Reference in New Issue
Block a user