mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
Added support to add and remove custom fields from the message parsers
This commit is contained in:
parent
f13031c091
commit
9cb82feb19
@ -53,257 +53,237 @@ IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
||||
// ---
|
||||
|
||||
// --- BEGIN Custom Code
|
||||
|
||||
// Firts of all init List of Parsers!
|
||||
InitMessageParsers();
|
||||
|
||||
if ( isset($_GET['op']) )
|
||||
{
|
||||
if ($_GET['op'] == "add")
|
||||
{
|
||||
// Set Mode to add
|
||||
$content['ISEDITORNEWSEARCH'] = "true";
|
||||
$content['SEARCH_FORMACTION'] = "addnewsearch";
|
||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_ADD'];
|
||||
|
||||
//PreInit these values
|
||||
$content['DisplayName'] = "";
|
||||
$content['SearchQuery'] = "";
|
||||
|
||||
// General stuff
|
||||
$content['userid'] = null;
|
||||
$content['CHECKED_ISUSERONLY'] = "";
|
||||
$content['SEARCHID'] = "";
|
||||
|
||||
// --- Check if groups are available
|
||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||
if ( is_array($content['SUBGROUPS']) )
|
||||
$content['ISGROUPSAVAILABLE'] = true;
|
||||
else
|
||||
$content['ISGROUPSAVAILABLE'] = false;
|
||||
}
|
||||
else if ($_GET['op'] == "edit")
|
||||
if ($_GET['op'] == "details")
|
||||
{
|
||||
// Set Mode to edit
|
||||
$content['ISEDITORNEWSEARCH'] = "true";
|
||||
$content['SEARCH_FORMACTION'] = "editsearch";
|
||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_EDIT'];
|
||||
$content['ISSHOWDETAILS'] = "true";
|
||||
// $content['SEARCH_FORMACTION'] = "editsearch";
|
||||
// $content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_EDIT'];
|
||||
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['SEARCHID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
$sqlquery = "SELECT * " .
|
||||
" FROM " . DB_SEARCHES .
|
||||
" WHERE ID = " . $content['SEARCHID'];
|
||||
|
||||
$result = DB_Query($sqlquery);
|
||||
$mysearch = DB_GetSingleRow($result, true);
|
||||
if ( isset($mysearch['DisplayName']) )
|
||||
$content['ParserID'] = DB_RemoveBadChars($_GET['id']);
|
||||
if ( isset($content['PARSERS'][ $content['ParserID'] ]) )
|
||||
{
|
||||
$content['SEARCHID'] = $mysearch['ID'];
|
||||
$content['DisplayName'] = $mysearch['DisplayName'];
|
||||
$content['SearchQuery'] = $mysearch['SearchQuery'];
|
||||
if ( $mysearch['userid'] != null )
|
||||
$content['CHECKED_ISUSERONLY'] = "checked";
|
||||
else
|
||||
$content['CHECKED_ISUSERONLY'] = "";
|
||||
// Get Reference to parser!
|
||||
$myParser = $content['PARSERS'][ $content['ParserID'] ];
|
||||
|
||||
$content['DisplayName'] = $myParser['DisplayName'];
|
||||
$content['Description'] = $myParser['Description'];
|
||||
|
||||
// --- Check if groups are available
|
||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||
if ( is_array($content['SUBGROUPS']) )
|
||||
if ( strlen($myParser['ParserHelpArticle']) > 0 )
|
||||
{
|
||||
// Process All Groups
|
||||
for($i = 0; $i < count($content['SUBGROUPS']); $i++)
|
||||
$content['EnableHelpArticle'] = true;
|
||||
$content['ParserHelpArticle'] = $myParser['ParserHelpArticle'];
|
||||
}
|
||||
|
||||
// check for custom fields
|
||||
if ( isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0 )
|
||||
{
|
||||
// Needs custom fields!
|
||||
$content['EnableCustomField'] = true;
|
||||
$content['CustomFieldsList'] = $myParser['CustomFieldsList'];
|
||||
|
||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
||||
{
|
||||
if ( $mysearch['groupid'] != null && $content['SUBGROUPS'][$i]['mygroupid'] == $mysearch['groupid'] )
|
||||
$content['SUBGROUPS'][$i]['group_selected'] = "selected";
|
||||
// check if field is in define list!
|
||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
||||
{
|
||||
$content['ParserInitEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
$content['SUBGROUPS'][$i]['group_selected'] = "";
|
||||
{
|
||||
$content['ParserDeleteEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISSHOWDETAILS'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_PARSERS_ERROR_IDNOTFOUND'], $content['ParserID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISSHOWDETAILS'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_PARSERS_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "removeparser")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['ParserID'] = DB_RemoveBadChars($_GET['id']);
|
||||
if ( isset($content['PARSERS'][ $content['ParserID'] ]) )
|
||||
{
|
||||
// Get Reference to parser!
|
||||
$myParser = $content['PARSERS'][ $content['ParserID'] ];
|
||||
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_PARSERS_WARNREMOVE'], $myParser['DisplayName'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
|
||||
// Check if we have fields to delete
|
||||
if ( isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0 )
|
||||
{
|
||||
// Helper counter
|
||||
$deletedFields = 0;
|
||||
|
||||
// Loop through all custom fields!
|
||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
||||
{
|
||||
// check if field is in define list!
|
||||
if ( array_key_exists($myField['FieldID'], $fields) )
|
||||
{
|
||||
$result = DB_Query( "DELETE FROM " . DB_FIELDS . " WHERE FieldID = '" . $myField['FieldID'] . "'");
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// increment counter
|
||||
$deletedFields++;
|
||||
}
|
||||
}
|
||||
|
||||
// Enable Group Selection
|
||||
$content['ISGROUPSAVAILABLE'] = true;
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_PARSERS_ERROR_HASBEENREMOVED'], $myParser['DisplayName'], $deletedFields ) , "parsers.php" );
|
||||
}
|
||||
else
|
||||
$content['ISGROUPSAVAILABLE'] = false;
|
||||
// ---
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISEDITORNEWSEARCH'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_PARSERS_ERROR_NOFIELDS'], $content['ParserID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISEDITORNEWSEARCH'] = false;
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
|
||||
$content['ERROR_MSG'] = $content['LN_PARSERS_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
else if ($_GET['op'] == "delete")
|
||||
else if ($_GET['op'] == "initparser")
|
||||
{
|
||||
if ( isset($_GET['id']) )
|
||||
{
|
||||
//PreInit these values
|
||||
$content['SEARCHID'] = DB_RemoveBadChars($_GET['id']);
|
||||
|
||||
// Get UserInfo
|
||||
$result = DB_Query("SELECT DisplayName FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID'] );
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['DisplayName']) )
|
||||
$content['ParserID'] = DB_RemoveBadChars($_GET['id']);
|
||||
if ( isset($content['PARSERS'][ $content['ParserID'] ]) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
// Get Reference to parser!
|
||||
$myParser = $content['PARSERS'][ $content['ParserID'] ];
|
||||
|
||||
// --- Ask for deletion first!
|
||||
if ( (!isset($_GET['verify']) || $_GET['verify'] != "yes") )
|
||||
{
|
||||
// This will print an additional secure check which the user needs to confirm and exit the script execution.
|
||||
PrintSecureUserCheck( GetAndReplaceLangStr( $content['LN_SEARCH_WARNDELETESEARCH'], $myrow['DisplayName'] ), $content['LN_DELETEYES'], $content['LN_DELETENO'] );
|
||||
}
|
||||
// ---
|
||||
// check for custom fields
|
||||
if ( isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0 )
|
||||
{
|
||||
// Helper counter
|
||||
$addedFields = 0;
|
||||
|
||||
// do the delete!
|
||||
$result = DB_Query( "DELETE FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID'] );
|
||||
if ($result == FALSE)
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_DELSEARCH'], $content['SEARCHID'] );
|
||||
// Loop through all custom fields!
|
||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
||||
{
|
||||
// check if field is in define list!
|
||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
||||
{
|
||||
// Add field into DB!
|
||||
$sqlquery = "INSERT INTO " . DB_FIELDS . " (FieldID, FieldCaption, FieldDefine, SearchField, FieldAlign, DefaultWidth, FieldType, SearchOnline)
|
||||
VALUES (
|
||||
'" . $myField['FieldID'] . "',
|
||||
'" . $myField['FieldCaption'] . "',
|
||||
'" . $myField['FieldDefine'] . "',
|
||||
'" . $myField['SearchField'] . "',
|
||||
'" . $myField['FieldAlign'] . "',
|
||||
" . $myField['DefaultWidth'] . ",
|
||||
" . $myField['FieldType'] . ",
|
||||
" . $myField['SearchOnline'] . "
|
||||
)";
|
||||
$result = DB_Query($sqlquery);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// increment counter
|
||||
$addedFields++;
|
||||
}
|
||||
}
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_PARSERS_ERROR_HASBEENADDED'], $myParser['DisplayName'], $addedFields ) , "parsers.php" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_PARSERS_ERROR_NOFIELDS'], $content['ParserID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_HASBEENDEL'], $myrow['DisplayName'] ) , "searches.php" );
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_PARSERS_ERROR_IDNOTFOUND'], $content['ParserID'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['op']) )
|
||||
{
|
||||
if ( isset ($_POST['id']) ) { $content['SEARCHID'] = intval(DB_RemoveBadChars($_POST['id'])); } else {$content['SEARCHID'] = -1; }
|
||||
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
|
||||
if ( isset ($_POST['SearchQuery']) ) { $content['SearchQuery'] = DB_RemoveBadChars($_POST['SearchQuery']); } else {$content['SearchQuery'] = ""; }
|
||||
|
||||
// User & Group handeled specially
|
||||
if ( isset ($_POST['isuseronly']) )
|
||||
{
|
||||
$content['userid'] = $content['SESSION_USERID'];
|
||||
$content['groupid'] = "null"; // Either user or group not both!
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['userid'] = "null";
|
||||
if ( isset ($_POST['groupid']) && $_POST['groupid'] != -1 )
|
||||
$content['groupid'] = intval($_POST['groupid']);
|
||||
else
|
||||
$content['groupid'] = "null";
|
||||
}
|
||||
|
||||
// --- Check mandotary values
|
||||
if ( $content['DisplayName'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_DISPLAYNAMEEMPTY'];
|
||||
}
|
||||
else if ( $content['SearchQuery'] == "" )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_SEARCHQUERYEMPTY'];
|
||||
}
|
||||
// ---
|
||||
|
||||
if ( !isset($content['ISERROR']) )
|
||||
{
|
||||
// Everything was alright, so we go to the next step!
|
||||
if ( $_POST['op'] == "addnewsearch" )
|
||||
{
|
||||
// Add custom search now!
|
||||
$sqlquery = "INSERT INTO " . DB_SEARCHES . " (DisplayName, SearchQuery, userid, groupid)
|
||||
VALUES ('" . $content['DisplayName'] . "',
|
||||
'" . $content['SearchQuery'] . "',
|
||||
" . $content['userid'] . ",
|
||||
" . $content['groupid'] . "
|
||||
)";
|
||||
$result = DB_Query($sqlquery);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Do the final redirect
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], $content['DisplayName'] ) , "searches.php" );
|
||||
}
|
||||
else if ( $_POST['op'] == "editsearch" )
|
||||
{
|
||||
$result = DB_Query("SELECT ID FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID']);
|
||||
$myrow = DB_GetSingleRow($result, true);
|
||||
if ( !isset($myrow['ID']) )
|
||||
{
|
||||
$content['ISERROR'] = true;
|
||||
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Edit the Search Entry now!
|
||||
$result = DB_Query("UPDATE " . DB_SEARCHES . " SET
|
||||
DisplayName = '" . $content['DisplayName'] . "',
|
||||
SearchQuery = '" . $content['SearchQuery'] . "',
|
||||
userid = " . $content['userid'] . ",
|
||||
groupid = " . $content['groupid'] . "
|
||||
WHERE ID = " . $content['SEARCHID']);
|
||||
DB_FreeQuery($result);
|
||||
|
||||
// Done redirect!
|
||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENEDIT'], $content['DisplayName']) , "searches.php" );
|
||||
}
|
||||
$content['ERROR_MSG'] = $content['LN_PARSERS_ERROR_INVALIDID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Default mode!
|
||||
if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
{
|
||||
// Default Mode = List Searches
|
||||
$content['LISTPARSERS'] = "true";
|
||||
|
||||
// Init List of Parsers
|
||||
InitMessageParsers();
|
||||
// $content['PARSERS'] = $content['Search'];
|
||||
|
||||
if ( isset($content['PARSERS']) )
|
||||
{
|
||||
$i = 0; // Help counter!
|
||||
foreach ($content['PARSERS'] as &$myParsers )
|
||||
{
|
||||
// $mySearch['SearchQuery_Display'] = strlen($mySearch['SearchQuery']) > 25 ? substr($mySearch['SearchQuery'], 0, 25) . " ..." : $mySearch['SearchQuery'];
|
||||
// Default Mode = List Searches
|
||||
$content['LISTPARSERS'] = "true";
|
||||
|
||||
// Allow EDIT
|
||||
// $mySearch['ActionsAllowed'] = true;
|
||||
|
||||
$i = 0; // Help counter!
|
||||
foreach ($content['PARSERS'] as &$myParser )
|
||||
{
|
||||
// Set if help link is enabled
|
||||
if ( strlen($myParsers['ParserHelpArticle']) > 0 )
|
||||
$myParsers['ParserHelpEnabled'] = true;
|
||||
if ( strlen($myParser['ParserHelpArticle']) > 0 )
|
||||
$myParser['ParserHelpEnabled'] = true;
|
||||
else
|
||||
$myParsers['ParserHelpEnabled'] = false;
|
||||
$myParser['ParserHelpEnabled'] = false;
|
||||
|
||||
// Find out if we need to INIT something!
|
||||
if ( isset($myParsers['CustomFieldsList']) && count($myParsers['CustomFieldsList']) > 0 )
|
||||
if ( isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0 )
|
||||
{
|
||||
// $myParsers['CustomFieldsList'];
|
||||
|
||||
$myParsers['ParserInitEnabled'] = true;
|
||||
|
||||
foreach( $myParser['CustomFieldsList'] as $myField )
|
||||
{
|
||||
// check if field is in define list!
|
||||
if ( !array_key_exists($myField['FieldID'], $fields) )
|
||||
{
|
||||
$myParser['ParserInitEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$myParser['ParserDeleteEnabled'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- Set CSS Class
|
||||
if ( $i % 2 == 0 )
|
||||
$myParsers['cssclass'] = "line1";
|
||||
$myParser['cssclass'] = "line1";
|
||||
else
|
||||
$myParsers['cssclass'] = "line2";
|
||||
$myParser['cssclass'] = "line2";
|
||||
$i++;
|
||||
// ---
|
||||
}
|
||||
|
@ -30,27 +30,6 @@
|
||||
* A copy of the GPL can be found in the file "COPYING" in this
|
||||
* distribution.
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
* NEEDED FIELDS!
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_interface', 'SYSLOG_NET_INTERFACE', 'Interface', 0, 0, 100, 'center', 'net_interface', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_mac_address', 'SYSLOG_NET_MAC_ADDRESS', 'Mac Address', 0, 0, 125, 'left', 'net_mac_address', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_lastip', 'SYSLOG_NET_LASTIP', 'Last IP Address', 0, 0, 100, 'left', 'net_lastip', 1, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_rxrate', 'SYSLOG_NET_RXRATE', 'RX Rate', 0, 0, 65, 'center', 'net_rxrate', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_txrate', 'SYSLOG_NET_TXRATE', 'TX Rate', 0, 0, 65, 'center', 'net_txrate', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_uptime', 'SYSLOG_NET_UPTIME', 'System Uptime', 0, 0, 85, 'center', 'net_uptime', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_lastactivity', 'SYSLOG_NET_LASTACTIVITY', 'Last Activity', 0, 0, 80, 'center', 'net_lastactivity', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_signalstrength', 'SYSLOG_NET_SIGNALSTRENGTH', 'Signal strength', 0, 0, 100, 'center', 'net_signalstrength', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_signaltonoise', 'SYSLOG_NET_SIGNALTONOISE', 'Signal to noise', 1, 0, 50, 'center', 'net_signaltonoise', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_txccq', 'SYSLOG_NET_TXCCQ', 'TX CCQ', 1, 0, 50, 'center', 'net_txccq', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_bytesrecieved', 'SYSLOG_NET_BYTESRECIEVED', 'Bytes recieved', 1, 0, 50, 'left', 'net_bytesrecieved', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_bytessend', 'SYSLOG_NET_BYTESSEND', 'Bytes send', 1, 0, 50, 'left', 'net_bytessend', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_packetsrecieved', 'SYSLOG_NET_PACKETSRECIEVED', 'Packets recieved', 1, 0, 50, 'left', 'net_packetsrecieved', 0, 0);
|
||||
INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_packetssend', 'SYSLOG_NET_PACKETSSEND', 'Packets send', 1, 0, 50, 'left', 'net_packetssend', 0, 0);
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// --- Avoid directly accessing this file!
|
||||
@ -75,7 +54,7 @@ class MsgParser_wireless extends MsgParser {
|
||||
public $_ClassDescription = 'Custom logfile parser for wireless access points.';
|
||||
public $_ClassHelpArticle = "";
|
||||
public $_ClassRequiredFields = array (
|
||||
"net_bytesrecieved" => array ( "FieldID" => "net_bytesrecieved", "FieldDefine" => "SYSLOG_NET_BYTESRECIEVED", "FieldCaption" => "Bytes recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytesrecieved", "DefaultWidth" => 50, "SearchOnline" => false, "Trunscate" => false, "Sortable" => false),
|
||||
"net_bytesrecieved" => array ( "FieldID" => "net_bytesrecieved", "FieldDefine" => "SYSLOG_NET_BYTESRECIEVED", "FieldCaption" => "Bytes recieved", "FieldType" => 1, "FieldAlign" => "left", "SearchField" => "net_bytesrecieved", "DefaultWidth" => 50, "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" => 50, "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" => 100, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
|
||||
"net_lastactivity" => array (", ", "FieldID" => "net_lastactivity", "FieldDefine" => "SYSLOG_NET_LASTACTIVITY", "FieldCaption" => "Last Activity", "FieldType" => 0, "FieldAlign" => "center", "SearchField" => "net_lastactivity", "DefaultWidth" => 80, "SearchOnline" => 0, "Trunscate" => 0, "Sortable" => 0),
|
||||
|
@ -248,14 +248,14 @@ function InitMessageParsers()
|
||||
}
|
||||
|
||||
// Add entry to msg parser list!
|
||||
$content['PARSERS'][] = array (
|
||||
"ID" => $myParserID,
|
||||
"DisplayName" => $szParserName,
|
||||
"Description" => $szParserDescription,
|
||||
"CustomFields" => $bCustomFields,
|
||||
"CustomFieldsList" => $aCustomFieldList,
|
||||
"ParserHelpArticle" => $szParserHelpArticle,
|
||||
);
|
||||
$content['PARSERS'][$myParserID] = array (
|
||||
"ID" => $myParserID,
|
||||
"DisplayName" => $szParserName,
|
||||
"Description" => $szParserDescription,
|
||||
"CustomFields" => $bCustomFields,
|
||||
"CustomFieldsList" => $aCustomFieldList,
|
||||
"ParserHelpArticle" => $szParserHelpArticle,
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -299,24 +299,23 @@ $content['LN_FILTER_TYPE_DATE'] = "Date";
|
||||
// Parser Options
|
||||
$content['LN_PARSERS_EDIT'] = "Edit Message Parser";
|
||||
$content['LN_PARSERS_DELETE'] = "Delete Message Parser";
|
||||
$content['LN_PARSERS_ID'] = "Parser ID";
|
||||
$content['LN_PARSERS_NAME'] = "Parser Name";
|
||||
$content['LN_PARSERS_DESCRIPTION'] = "Short Description";
|
||||
$content['LN_PARSERS_ID'] = "Message Parser ID";
|
||||
$content['LN_PARSERS_NAME'] = "Message Parser Name";
|
||||
$content['LN_PARSERS_DESCRIPTION'] = "Message Parser Description";
|
||||
$content['LN_PARSERS_ERROR_NOPARSERS'] = "There were no valid message parsers found in your installation. ";
|
||||
$content['LN_PARSERS_HELP'] = "Help";
|
||||
$content['LN_PARSERS_HELP_CLICK'] = "Click here for more help";
|
||||
$content['LN_PARSERS_INFO'] = "Show more Information for this message parser.";
|
||||
$content['LN_PARSERS_INIT'] = "Initialize settings for this message parser.";
|
||||
$content['LN_PARSERS_REMOVE'] = "Remove settings for this message parser.";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_ERROR_IDNOTFOUND'] = "There was no message parser with ID '%1' found.";
|
||||
$content['LN_PARSERS_ERROR_INVALIDID'] = "Invalid message parser id.";
|
||||
$content['LN_PARSERS_DETAILS'] = "Details for this Parser";
|
||||
$content['LN_PARSERS_CUSTOMFIELDS'] = "The following Custom fields are needed by this Message Parser.";
|
||||
$content['LN_PARSERS_WARNREMOVE'] = "You are about to remove the custom fields needed by the '%1' Message Parser. However you can add these fields again if you change your mind.";
|
||||
$content['LN_PARSERS_ERROR_HASBEENREMOVED'] = "All settings ('%2' custom fields) for the Message Parser '%1' have been removed. ";
|
||||
$content['LN_PARSERS_ERROR_HASBEENADDED'] = "All required settings ('%2' custom fields) for the Message Parser '%1' have been added. ";
|
||||
$content['LN_PARSERS_ERROR_NOFIELDS'] = "The Message Parser '%1' does not have any custom fields to add.";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
$content['LN_PARSERS_'] = "";
|
||||
|
@ -56,30 +56,54 @@
|
||||
<!-- ENDIF LISTPARSERS="true" -->
|
||||
|
||||
<!-- IF ISSHOWDETAILS="true" -->
|
||||
<form action="{BASEPATH}admin/searches.php" method="post">
|
||||
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||
<tr>
|
||||
<td align="center" class="cellmenu1" colspan="2"><b>{LN_SEARCH_ADDEDIT}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2" width="250"><b>{LN_SEARCH_NAME}</b></td>
|
||||
<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="right" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value="{SearchQuery}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
<input type="submit" value="{SEARCH_SENDBUTTON}">
|
||||
<input type="hidden" name="op" value="{SEARCH_FORMACTION}">
|
||||
<input type="hidden" name="id" value="{SEARCHID}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||
<tr>
|
||||
<td align="center" class="cellmenu1" colspan="2"><b>{LN_PARSERS_DETAILS}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2" width="250"><b>{LN_PARSERS_ID}</b></td>
|
||||
<td align="left" class="line1" width="350">{ParserID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2"><b>{LN_PARSERS_NAME}</b></td>
|
||||
<td align="left" class="line2">{DisplayName}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2" valign="top"><b>{LN_PARSERS_DESCRIPTION}</b></td>
|
||||
<td align="left" class="line1">{Description}</td>
|
||||
</tr>
|
||||
<!-- IF EnableCustomField="true" -->
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2" valign="top"><b>{LN_PARSERS_CUSTOMFIELDS}</b></td>
|
||||
<td align="left" class="line1">
|
||||
<!-- BEGIN CustomFieldsList -->
|
||||
<br><B>{FieldCaption}</B> ({FieldDefine})
|
||||
<!-- END CustomFieldsList -->
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF EnableCustomField="true" -->
|
||||
<!-- IF EnableHelpArticle="true" -->
|
||||
<tr>
|
||||
<td align="left" class="cellmenu2"><b>{LN_PARSERS_HELP}</b></td>
|
||||
<td align="center" class="line2"><a href="{ParserHelpArticle}">{LN_PARSERS_HELP_CLICK}</a></td>
|
||||
</tr>
|
||||
<!-- ENDIF EnableHelpArticle="true" -->
|
||||
<tr>
|
||||
<td align="center" class="tableBackground" colspan="2">
|
||||
<!-- IF ParserInitEnabled="true" -->
|
||||
<a href="{BASEPATH}admin/parsers.php?op=initparser&id={ParserID}"><img src="{MENU_PARSER_INIT}" width="16" title="{LN_PARSERS_INIT}"> {LN_PARSERS_INIT}</a>
|
||||
<!-- ENDIF ParserInitEnabled="true" -->
|
||||
<!-- IF ParserDeleteEnabled="true" -->
|
||||
<a href="{BASEPATH}admin/parsers.php?op=removeparser&id={ParserID}"><img src="{MENU_PARSER_DELETE}" width="16" title="{LN_PARSERS_REMOVE}"> {LN_PARSERS_REMOVE}</a>
|
||||
<!-- ENDIF ParserDeleteEnabled="true" -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- ENDIF ISSHOWDETAILS="true" -->
|
||||
|
||||
<br><br>
|
||||
<a href="javascript:history.back();" target="_top">{LN_GEN_ERRORRETURNPREV}</a>
|
||||
<br><br>
|
||||
|
||||
</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user