Merge pull request #88 from diabolusss/master

Some minor search result style changes + datelastx
This commit is contained in:
Andre Lorbach 2023-02-03 20:41:16 +01:00 committed by GitHub
commit 4f3be89252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 513 additions and 155 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
src/config.php
*.bak
src/index.html

52
README.md Normal file
View File

@ -0,0 +1,52 @@
# loganalyzer
![loganalizer_example](https://user-images.githubusercontent.com/8426197/209875963-b7438f3b-9052-4e8f-9f22-05794e1e54a5.png)
Adiscon LogAnalyzer, a web frontend to log data from the same folks the created rsyslog
# todo
- export: add checkbox to export full filtered history (now exports only current page)
- export: place ts into export filename (range from-to)
- BUG: "Suppress duplicated messages" doesn't work
- filter: allow to specify AFTER:n BEFORE:n (if possible/fast to implement) <- include records before and after match
- export: configure columns for file export (allow to remove unnecessary columns) <- exclude list of columns
- BUG: sometimes spinner on index page is drawn in the middle of page irrespective of it's size, but should be drawn in the middle of screen
# changes 230121
- datelastx - keep for backward compatibility (for saved searches); add datelastxx
# changes 230114
- fix bug: WHERE ( message LIKE '%LTE%unreachable%' ) give no result on filter page, yet works for charts, i.e. input = msg:LTE%unreachable (todo# in chart records have wrong date today merged with yesterday)
- cfg[EventEmptySearchDefaultFilter] - config to use in case filter is empty (first load)
- cfg[ExportUseTodayYesterday] - allow to export date in case today/yesterday enabled
- CFG[Default_AUTORELOAD_ID] - control default autoreload mode
- cfg[SESSION_MAXIMIZED] - control maximized mode
- filter: support "limit:int" tag - disable paging and query less than configured for page (LogStreamDB->_SQLcustomLimitHaltSearchAfter)
![limit_10](https://user-images.githubusercontent.com/8426197/212502393-d05d0cb9-4baf-4008-838b-ce078b6eeb8b.png)
- filter: datelastx - handle as float number
- export: allow to EXPORT_PLAIN text format
- custom bug fixes
- rename SYSLOG_TRACE to CUSTOM_TRACE;
- translations: {LN_CHART_ORDERBY, LN_CHART_FILTER, LN_GEN_EMPTYSRCHFILTR, LN_GEN_EXPORT_PLAIN, LN_GEN_EXPORT_USETODAY, LN_GEN_SESSION_MAX}
# changes
- fix bug: chart double adding same key into search
- allow to configure ORDER BY clause
- add custom filter to chart value redirection link if such exists
![chart_custom](https://user-images.githubusercontent.com/8426197/210448944-9a67c91c-1ca7-4f00-99ac-a5eebd566927.png)
- filter: support number ranges, i.e. severity:3-6 -> where severity in (3,4,5,6)
- filter: support quoted filters, i.e. syslogtag:-="dhcp,info",-="wireless,info",-"system%,account" -> where (syslogtag <> 'dhcp,info' AND syslogtag <> 'wireless,info' AND syslogtag NOT LIKE '%system%,account%' )
- filter: support TRACE severity level;
- gui: add loglevel style colors and change color for full line;
- filter: change datelastx behaviour - use number as hours indicator, i.e. datelastx:3 is 3 hours limit
#obsolete
- filter: allow to OR msg, i.e. key1 &key2 |key3;
- filter: date{from,to} - allow to use today/yesterday + short time, i.e. today 1h same as 1h, yesterday 2h, since/after/before/etc.
- "Maximize view" - reloads page and resets search filter, hide toolbars with js instead
- changing "Autoreload" does the same as "Max. view"
- allow to manually configure log levels (severity) instead of using constants
- cfg[ExportCSVDelimiter,ExportCSVQuoteValues] - allow to EXPORT_PLAIN text format

View File

@ -154,7 +154,8 @@ if ( isset($_GET['op']) )
$content['CHECKED_ISSHOWPERCENT'] = "";
$content['chart_defaultfilter'] = "";
// Chart Field
$content['chart_field'] = SYSLOG_HOST;
$content['chart_field'] = SYSLOG_HOST;
$content['chart_orderby'] = '';
CreateChartFields($content['chart_field']);
// COMMON Fields
@ -194,7 +195,6 @@ if ( isset($_GET['op']) )
{
// Get Source reference
$myChart = $content['Charts'][ $content['CHARTID'] ];
// Copy basic properties
$content['Name'] = $myChart['DisplayName'];
$content['chart_type'] = $myChart['chart_type'];
@ -216,7 +216,8 @@ if ( isset($_GET['op']) )
// Chart Field
$content['chart_field'] = $myChart['chart_field'];
CreateChartFields($content['chart_field']);
$content['chart_orderby'] = $myChart['chart_orderby'];
// COMMON Fields
$content['userid'] = $myChart['userid'];
if ( $content['userid'] != null )
@ -317,6 +318,7 @@ if ( isset($_POST['op']) )
if ( isset($_POST['chart_type']) ) { $content['chart_type'] = intval(DB_RemoveBadChars($_POST['chart_type'])); }
if ( isset($_POST['chart_width']) ) { $content['chart_width'] = intval(DB_RemoveBadChars($_POST['chart_width'])); } else {$content['chart_width'] = 400; }
if ( isset($_POST['chart_field']) ) { $content['chart_field'] = DB_RemoveBadChars($_POST['chart_field']); }
if ( isset($_POST['chart_orderby']) ) { $content['chart_orderby'] = DB_RemoveBadChars($_POST['chart_orderby']); }
if ( isset($_POST['maxrecords']) ) { $content['maxrecords'] = intval(DB_RemoveBadChars($_POST['maxrecords'])); }
if ( isset($_POST['showpercent']) ) { $content['showpercent'] = intval(DB_RemoveBadChars($_POST['showpercent'])); } else {$content['showpercent'] = 0; }
if ( isset($_POST['chart_defaultfilter']) ) { $content['chart_defaultfilter'] = DB_RemoveBadChars($_POST['chart_defaultfilter']); }
@ -369,12 +371,13 @@ if ( isset($_POST['op']) )
if ( $_POST['op'] == "addnewchart" )
{
// Add custom search now!
$sqlquery = "INSERT INTO " . DB_CHARTS . " (DisplayName, chart_enabled, chart_type, chart_width, chart_field, chart_defaultfilter, maxrecords, showpercent, userid, groupid)
$sqlquery = "INSERT INTO " . DB_CHARTS . " (DisplayName, chart_enabled, chart_type, chart_width, chart_field, chart_orderby, chart_defaultfilter, maxrecords, showpercent, userid, groupid)
VALUES ('" . $content['Name'] . "',
" . $content['chart_enabled'] . ",
" . $content['chart_type'] . ",
" . $content['chart_width'] . ",
'" . $content['chart_field'] . "',
'" . $content['chart_orderby'] . "',
'" . $content['chart_defaultfilter'] . "',
" . $content['maxrecords'] . ",
" . $content['showpercent'] . ",
@ -405,6 +408,7 @@ if ( isset($_POST['op']) )
chart_type = " . $content['chart_type'] . ",
chart_width = " . $content['chart_width'] . ",
chart_field = '" . $content['chart_field'] . "',
chart_orderby = '" . $content['chart_orderby'] . "',
chart_defaultfilter = '" . $content['chart_defaultfilter'] . "',
maxrecords = " . $content['maxrecords'] . ",
showpercent = " . $content['showpercent'] . ",
@ -514,6 +518,12 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
$myChart['chart_defaultfilter_urldecoded'] = urlencode($myChart['chart_defaultfilter']);
else
$myChart['chart_defaultfilter_urldecoded'] = "";
if ( ( isset($myChart['chart_orderby']) ) && ( strlen($myChart['chart_orderby']) > 0 ) )
$myChart['chart_orderby_urldecoded'] = urlencode($myChart['chart_orderby']);
else
$myChart['chart_orderby_urldecoded'] = "";
// ---
// --- Set CSS Class
@ -544,4 +554,4 @@ $page -> parser($content, "admin/admin_charts.html");
$page -> output();
// ---
?>
?>

View File

@ -167,6 +167,8 @@ if ( isset($_POST['op']) )
if ( isset ($_POST['DefaultFontSize']) ) { $content['DefaultFontSize'] = $_POST['DefaultFontSize']; }
// Read checkboxes
if ( isset ($_POST['ExportUseTodayYesterday']) ) { $content['ExportUseTodayYesterday'] = 1; } else { $content['ExportUseTodayYesterday'] = 0; }
if ( isset ($_POST['SESSION_MAXIMIZED']) ) { $content['SESSION_MAXIMIZED'] = 1; } else { $content['SESSION_MAXIMIZED'] = 0; }
if ( isset ($_POST['ViewUseTodayYesterday']) ) { $content['ViewUseTodayYesterday'] = 1; } else { $content['ViewUseTodayYesterday'] = 0; }
if ( isset ($_POST['ViewEnableDetailPopups']) ) { $content['ViewEnableDetailPopups'] = 1; } else { $content['ViewEnableDetailPopups'] = 0; }
if ( isset ($_POST['EnableContextLinks']) ) { $content['EnableContextLinks'] = 1; } else { $content['EnableContextLinks'] = 0; }
@ -195,6 +197,7 @@ if ( isset($_POST['op']) )
if ( isset ($_POST['PrependTitle']) ) { $content['PrependTitle'] = $_POST['PrependTitle']; }
if ( isset ($_POST['SearchCustomButtonCaption']) ) { $content['SearchCustomButtonCaption'] = $_POST['SearchCustomButtonCaption']; }
if ( isset ($_POST['SearchCustomButtonSearch']) ) { $content['SearchCustomButtonSearch'] = $_POST['SearchCustomButtonSearch']; }
if ( isset ($_POST['EventEmptySearchDefaultFilter']) ) { $content['EventEmptySearchDefaultFilter'] = $_POST['EventEmptySearchDefaultFilter']; }
if ( isset ($_POST['InjectHtmlHeader']) ) { $content['InjectHtmlHeader'] = $_POST['InjectHtmlHeader']; }
if ( isset ($_POST['InjectBodyHeader']) ) { $content['InjectBodyHeader'] = $_POST['InjectBodyHeader']; }
@ -256,6 +259,8 @@ if ( isset($_POST['op']) )
if ( isset ($_POST['User_PrependTitle']) ) { $USERCFG['PrependTitle'] = $_POST['User_PrependTitle']; }
if ( isset ($_POST['User_SearchCustomButtonCaption']) ) { $USERCFG['SearchCustomButtonCaption'] = $_POST['User_SearchCustomButtonCaption']; }
if ( isset ($_POST['User_SearchCustomButtonSearch']) ) { $USERCFG['SearchCustomButtonSearch'] = $_POST['User_SearchCustomButtonSearch']; }
if ( isset ($_POST['User_EventEmptySearchDefaultFilter']) ) { $USERCFG['EventEmptySearchDefaultFilter'] = $_POST['User_EventEmptySearchDefaultFilter']; }
// Save configuration variables now
SaveUserGeneralSettingsIntoDB();
@ -273,6 +278,9 @@ if ( !isset($content['InlineOnlineSearchIcons']) ) { $content['InlineOnlineSearc
if ( !isset($content['AdminChangeWaitTime']) ) { $content['AdminChangeWaitTime'] = 2; }
// Set checkbox States
if (isset($content['ExportUseTodayYesterday']) && $content['ExportUseTodayYesterday'] == 1) { $content['ExportUseTodayYesterday_checked'] = "checked"; } else { $content['ExportUseTodayYesterday_checked'] = ""; }
if (isset($content['SESSION_MAXIMIZED']) && $content['SESSION_MAXIMIZED'] == 1) { $content['SESSION_MAXIMIZED_checked'] = "checked"; } else { $content['SESSION_MAXIMIZED_checked'] = ""; }
if (isset($content['ViewUseTodayYesterday']) && $content['ViewUseTodayYesterday'] == 1) { $content['ViewUseTodayYesterday_checked'] = "checked"; } else { $content['ViewUseTodayYesterday_checked'] = ""; }
if (isset($content['ViewEnableDetailPopups']) && $content['ViewEnableDetailPopups'] == 1) { $content['ViewEnableDetailPopups_checked'] = "checked"; } else { $content['ViewEnableDetailPopups_checked'] = ""; }
if (isset($content['EnableContextLinks']) && $content['EnableContextLinks'] == 1) { $content['EnableContextLinks_checked'] = "checked"; } else { $content['EnableContextLinks_checked'] = ""; }
@ -388,6 +396,9 @@ foreach ( $content['ENCODINGS'] as &$myEncoding)
if ( $content['ENABLEUSEROPTIONS'] )
{
// Set checkbox States
if ( GetConfigSetting('ExportUseTodayYesterday', $content['ExportUseTodayYesterday'], CFGLEVEL_USER) == 1) { $content['User_ExportUseTodayYesterday_checked'] = "checked"; } else { $content['User_ExportUseTodayYesterday_checked'] = ""; }
if ( GetConfigSetting('SESSION_MAXIMIZED', $content['SESSION_MAXIMIZED'], CFGLEVEL_USER) == 1) { $content['User_SESSION_MAXIMIZED_checked'] = "checked"; } else { $content['User_SESSION_MAXIMIZED_checked'] = ""; }
if ( GetConfigSetting('ViewUseTodayYesterday', $content['ViewUseTodayYesterday'], CFGLEVEL_USER) == 1) { $content['User_ViewUseTodayYesterday_checked'] = "checked"; } else { $content['User_ViewUseTodayYesterday_checked'] = ""; }
if ( GetConfigSetting('ViewEnableDetailPopups', $content['ViewEnableDetailPopups'], CFGLEVEL_USER) == 1) { $content['User_ViewEnableDetailPopups_checked'] = "checked"; } else { $content['User_ViewEnableDetailPopups_checked'] = ""; }
if ( GetConfigSetting('EnableContextLinks', $content['EnableContextLinks'], CFGLEVEL_USER) == 1) { $content['User_EnableContextLinks_checked'] = "checked"; } else { $content['User_EnableContextLinks_checked'] = ""; }
@ -412,6 +423,8 @@ if ( $content['ENABLEUSEROPTIONS'] )
$content['User_AdminChangeWaitTime'] = GetConfigSetting('AdminChangeWaitTime', $content['AdminChangeWaitTime'], CFGLEVEL_USER);
$content['User_SearchCustomButtonCaption'] = GetConfigSetting('SearchCustomButtonCaption', $content['SearchCustomButtonCaption'], CFGLEVEL_USER);
$content['User_SearchCustomButtonSearch'] = GetConfigSetting('SearchCustomButtonSearch', $content['SearchCustomButtonSearch'], CFGLEVEL_USER);
$content['User_EventEmptySearchDefaultFilter'] = GetConfigSetting('EventEmptySearchDefaultFilter', $content['EventEmptySearchDefaultFilter'], CFGLEVEL_USER);
// ---
// --- Init for ViewDefaultTheme field!

View File

@ -98,6 +98,11 @@ else
$content['error_details'] = $content['LN_GEN_ERROR_MISSINGCHARTFIELD'];
}
if ( isset($_GET['orderby']) )
{
$content['chart_orderby'] = $_GET['orderby'];
}else { $content['chart_orderby'] = NULL; }
if ( isset($_GET['maxrecords']) )
{
// read and verify value
@ -148,7 +153,7 @@ if ( !$content['error_occured'] )
{
// Obtain and get the Config Object
$stream_config = $content['Sources'][$currentSourceID]['ObjRef'];
//echo "filter:".$content['chart_defaultfilter']."<br>";
// Create LogStream Object
$stream = $stream_config->LogStreamFactory($stream_config);
$stream->SetFilter($content['chart_defaultfilter']);
@ -160,7 +165,7 @@ if ( !$content['error_occured'] )
if ( $aFilterFields != null )
$content['ChartColumns'] = $aFilterFields;
// Append mandetory fields
// Append mandatory fields
if ( !in_array(SYSLOG_UID, $content['ChartColumns']) )
$content['ChartColumns'][] = SYSLOG_UID;
if ( !in_array($content['chart_field'], $content['ChartColumns']) )
@ -182,9 +187,9 @@ if ( !$content['error_occured'] )
// Split key and value
$tmpArray = explode(":", $myFilter, 2);
// Check if keyfield is valid and add to our Columns array if available
// Check if keyfield is valid and add to our Columns array only if it's not there yet
$newField = $stream->ReturnFilterKeyBySearchField($tmpArray[FILTER_TMP_KEY]);
if ( $newField )
if ( $newField && !in_array($newField,$content['ChartColumns']))
$content['ChartColumns'][] = $newField;
}
}
@ -195,8 +200,8 @@ if ( !$content['error_occured'] )
if ( $res == SUCCESS )
{
// Obtain data from the logstream!
$chartData = $stream->GetCountSortedByField($content['chart_field'], $content['chart_fieldtype'], $content['maxrecords']);
$chartData = $stream->GetCountSortedByField($content['chart_field'], $content['chart_fieldtype'], $content['maxrecords'], $content['chart_orderby']);
//echo "<pre>";echo print_r($chartData); echo "</pre><br>";
// If data is valid, we have an array!
if ( is_array($chartData) && count($chartData) > 0 )
{
@ -210,7 +215,7 @@ if ( !$content['error_occured'] )
$YchartData[] = intval($myData);
$XchartData[] = strlen($myKey) > 0 ? $myKey : "Unknown";
if ( isset($fields[$content['chart_field']]['SearchField']) && strlen($myKey) > 0 )
$chartImageMapLinks[] = $content['custombasepath'] . "index.php?filter=" . $fields[$content['chart_field']]['SearchField'] . "%3A%3D" . urlencode($szEncodedKeyStr) . "&search=Search";
$chartImageMapLinks[] = $content['custombasepath'] . "index.php?filter=" . $fields[$content['chart_field']]['SearchField'] . "%3A%3D" . urlencode($szEncodedKeyStr) .(empty($content['chart_defaultfilter'])?"":urlencode(" ".$content['chart_defaultfilter'])). "&search=Search";
else
$chartImageMapLinks[] = "";
@ -552,4 +557,4 @@ function OutpuCustomErrorMessage() {
// Exit in any case
exit;
}
?>
?>

View File

@ -472,19 +472,21 @@ abstract class LogStream {
// Only filter if value is non zero
if ( strlen($propertyvalue) > 0 && strlen($myfilter[FILTER_VALUE]) > 0 )
{
//check for % inside keyword and handle it accordingly, i.e. "key1%key2"
$strPosLike = strpos($myfilter[FILTER_VALUE], "%");
// 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 )
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) === false && $strPosLike === false )
$bEval = false;
}
// Exclude Filter
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_EXCLUDE )
{
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false )
if ( stripos($propertyvalue, $myfilter[FILTER_VALUE]) !== false && $strPosLike !== false)
$bEval = false;
}
}
@ -564,27 +566,40 @@ abstract class LogStream {
case FILTER_TYPE_DATE:
// Get Log TimeStamp
$nLogTimeStamp = $arrProperitesOut[$propertyname][EVTIME_TIMESTAMP];
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
//FIXME keep for backward compatibility
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
{
// Get current timestamp
$nNowTimeStamp = time();
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
$nNowTimeStamp = time();
//Get range timestamp
$nLastXTime = time() - (60 * 60 * floatval($myfilter[FILTER_VALUE]));
if ( $myfilter[FILTER_VALUE] == 1 /*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 )
else if ( $myfilter[FILTER_VALUE] == 2 /*DATE_LASTX_12HOURS*/ )
$nLastXTime = 60 * 60 * 12; // 12 Hours!
else if ( $myfilter[FILTER_VALUE] == 3 /*DATE_LASTX_24HOURS*/ )
$nLastXTime = 60 * 60 * 24; // 24 Hours!
else if ( $myfilter[FILTER_VALUE] == 4 /*DATE_LASTX_7DAYS*/ )
$nLastXTime = 60 * 60 * 24 * 7; // 7 days
else if ( $myfilter[FILTER_VALUE] == 5 /*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_LASTXX )
{//handle x as hours
//Get range timestamp
$nLastXTime = time() - (60 * 60 * floatval($myfilter[FILTER_VALUE]));
// If Nowtime + LastX is higher then the log timestamp, then this logline is too old for us.
if ( $nLastXTime > $nLogTimeStamp )
$bEval = false;
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_RANGE_FROM )
@ -752,7 +767,7 @@ abstract class LogStream {
// Use RegEx for intelligent splitting
$szFilterRgx = '/[\s]++(?=(?:(?:[^"]*+"){2})*+[^"]*+$)(?=(?:(?:[^\']*+\'){2})*+[^\']*+$)(?=(?:[^()]*+\([^()]*+\))*+[^()]*+$)/x';
$tmpEntries = preg_split($szFilterRgx, $szFilters, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
//DEBUG print_r ( $tmpEntries );
//echo "DEBUG:<pre>"; print_r ($tmpEntries ); echo "</pre>";
foreach($tmpEntries as $myEntry)
{
@ -761,14 +776,14 @@ abstract class LogStream {
continue;
if (
($pos = strpos($myEntry, ":")) !== false
($pos = strpos($myEntry, ":")) !== false
&&
($pos > 0 && substr($myEntry, $pos-1,1) != '\\') /* Only if character before is no backslash! */
)
($pos > 0 && substr($myEntry, $pos-1,1) != '\\') /* Only if character before is no backslash! */
)
{
// Split key and value
$tmpArray = explode(":", $myEntry, 2);
//print_r ( $tmpArray );
//echo "DEBUG: <pre>"; print_r ( $tmpArray ); echo "</pre>";
// Continue if empty filter!
if ( strlen(trim($tmpArray[FILTER_TMP_VALUE])) == 0 )
@ -777,18 +792,95 @@ abstract class LogStream {
// Check for multiple values!
if ( strpos($tmpArray[FILTER_TMP_VALUE], ",") )
{
// Split by comma and fill tmp Value array
$tmpValueArray = explode(",", $tmpArray[FILTER_TMP_VALUE]);
foreach($tmpValueArray as $myValueEntry)
{
// Append to temp array
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($myValueEntry), FILTER_TMP_VALUE => $myValueEntry );
//echo $tmpArray[FILTER_TMP_VALUE]."<br>";
$tmpArrayFilt = $tmpArray[FILTER_TMP_VALUE];
//don't parse quoted filter part - use it as a whole, i.e. param:"t1.1,t1.2",k2,k3 - search for (param like "%t1.1,t1.2%" or param like "%k2% or param like "%k3%")
//replace number range, i.e. 1-8, to 1,2,...,8
$myValueEntry = "";
$prevChar = "";
$quoteStart = false;
$numberRange = false;
$rangeStart = 0;
for ($i = 0; $i < strlen($tmpArrayFilt); $i++){
$strChar = $tmpArrayFilt[$i];
//echo $strChar."<br>";
if($numberRange){
//echo "#range#end#";
for($j = $rangeStart; $j < intval($strChar)+1; $j++){
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($j), FILTER_TMP_VALUE => $j);
}
$myValueEntry = '';
$rangeStart = 0;
$numberRange = false;
}//not filter start, not quoted, and is not negation, then it's a range
// TODO handle partial range, i.e. property:3-,-1,-4 = ignore 1,4 and find range from 3 to max_syslog_severity
else if($strChar === '-' && !$quoteStart && $prevChar !== ',' && $i !== 0 /*!filter start':'*/){
//echo "#range#start#".$prevChar;
$nextChar = $tmpArrayFilt[$i+1];
if(!is_numeric($nextChar)){//handle incomplete range as a singleton
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($prevChar), FILTER_TMP_VALUE => $prevChar);
}else{
$numberRange = true;
$rangeStart = intval($prevChar);
}
}//is not a separator inside quite, thus handle as usual
else if($strChar === ',' && !$quoteStart){
//echo "#comma#";
//if(!empty($myValueEntry)){
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($myValueEntry), FILTER_TMP_VALUE => $myValueEntry );
$myValueEntry = "";
//}
$prevChar = $strChar;
}//it's not escaped quote, handle it specially
else if($strChar === '"' && $prevChar !== '\\'){
//echo "#quote#";
if($quoteStart){//quoted str parsed; add filter into array as is
//echo "#qend#".$myValueEntry."<br>";
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($myValueEntry), FILTER_TMP_VALUE => $myValueEntry );
$myValueEntry = "";
$prevChar = "";
$quoteStart = false;
}else{
//echo "#qstart#";
$quoteStart = true;
//$prevChar = $strChar;
}
}else{//build filter string
//echo "#concat#";
$myValueEntry .= $strChar;
$prevChar = $strChar;
if(($i+1) == strlen($tmpArrayFilt)){//on last char insert filter instantly
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($myValueEntry), FILTER_TMP_VALUE => $myValueEntry );
}
}
}
}else{
//parse severity number range, i.e. 1-8 into 1,2,3,4,5,6,7,8
if($tmpArray[FILTER_TMP_KEY] == "severity" && !isset($tmpValues) && strpos($tmpArray[FILTER_TMP_VALUE],"-")){
$rangeBounds = explode("-", $tmpArray[FILTER_TMP_VALUE]);
for($j = intval($rangeBounds[0]); $j < intval($rangeBounds[1])+1; $j++){
$tmpValues[] = array( FILTER_TMP_MODE => $this->SetFilterIncludeMode($j), FILTER_TMP_VALUE => $j);
}
}
}
// Handle filter based
switch( $tmpArray[FILTER_TMP_KEY] )
{
case "limit":
$defaultPageLimit = GetConfigSetting("ViewEntriesPerPage", 50, CFGLEVEL_USER);
if($tmpArray[FILTER_TMP_VALUE] < $defaultPageLimit){
$this->_filters["limit"][FILTER_VALUE] = $tmpArray[FILTER_TMP_VALUE];
}else
$this->_filters["limit"][FILTER_VALUE] = $defaultPageLimit;
break;
case "facility":
$tmpKeyName = SYSLOG_FACILITY;
$tmpFilterType = FILTER_TYPE_NUMBER;
@ -865,13 +957,6 @@ abstract class LogStream {
}
}
/* OBSELETE CODE
foreach( $tmpValues as $mykey => $szValue )
{
// First set Filter Mode
$tmpValues[$mykey][FILTER_TMP_MODE] = $this->SetFilterIncludeMode($szValue);
}
*/
}
else
{
@ -968,11 +1053,16 @@ abstract class LogStream {
$tmpFilterType = FILTER_TYPE_DATE;
$tmpTimeMode = DATEMODE_RANGE_TO;
break;
case "datelastx":
case "datelastx": //FIXME keep for backward compatibility
$tmpKeyName = SYSLOG_DATE;
$tmpFilterType = FILTER_TYPE_DATE;
$tmpTimeMode = DATEMODE_LASTX;
break;
case "datelastxx":
$tmpKeyName = SYSLOG_DATE;
$tmpFilterType = FILTER_TYPE_DATE;
$tmpTimeMode = DATEMODE_LASTXX;
break;
case "timereported":
$tmpKeyName = SYSLOG_DATE;
$tmpFilterType = FILTER_TYPE_DATE;
@ -1228,7 +1318,7 @@ abstract class LogStream {
$pos = strpos($szValue, "+");
if ( $pos !== false && $pos == 0 )
{
//trunscate +
//truncate +
$szValue = substr( $szValue, 1);
$myBits = FILTER_MODE_INCLUDE;
}
@ -1246,7 +1336,7 @@ abstract class LogStream {
$pos = strpos($szValue, "=");
if ( $pos !== false && $pos == 0 )
{
//trunscate -
//truncate -
$szValue = substr( $szValue, 1);
// Add BIT if not NUMBER FIELD!
@ -1258,7 +1348,7 @@ abstract class LogStream {
$pos = strpos($szValue, "~");
if ( $pos !== false && $pos == 0 )
{
//trunscate -
//truncate -
$szValue = substr( $szValue, 1);
// Add BIT if not NUMBER FIELD!
if ( $myFilterType != FILTER_TYPE_NUMBER )
@ -1322,4 +1412,4 @@ abstract class LogStream {
}
}
?>
?>

View File

@ -62,6 +62,7 @@ class LogStreamDB extends LogStream {
private $_SQLwhereClause = "";
private $_myDBQuery = null;
private $_SQLcustomLimitHaltSearchAfter = null; //if set, then search will stop after getting this records
// Constructor
public function __construct ($streamConfigObj) {
@ -545,6 +546,12 @@ class LogStreamDB extends LogStream {
$ret = $this->ReadNextRecordsFromDB($uID);
else
{
// Override default value if custom limit is less - act as tail without paging
// NB it won't work if custom limit gt page limit
$limit = $this->_SQLcustomLimitHaltSearchAfter;
if(isset($limit) && $this->_currentRecordNum >= $limit)
$ret = ERROR_NOMORERECORDS;
if ( !isset($this->bufferedRecords[$this->_currentRecordNum] ) )
{
// We need to load new records, so clear the old ones first!
@ -590,7 +597,6 @@ class LogStreamDB extends LogStream {
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;
@ -618,7 +624,7 @@ class LogStreamDB extends LogStream {
// 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;
}
@ -1270,8 +1276,11 @@ class LogStreamDB extends LogStream {
*
* @return integer Error stat
*/
public function GetCountSortedByField($szFieldId, $nFieldType, $nRecordLimit)
public function GetCountSortedByField($szFieldId, $nFieldType, $nRecordLimit, $orderBy='')
{
if(empty($orderBy)){
$orderBy = 'totalcount DESC';
}
global $content, $dbmapping;
// Copy helper variables, this is just for better readability
@ -1283,13 +1292,14 @@ class LogStreamDB extends LogStream {
$myDBFieldName = $dbmapping[$szTableType]['DBMAPPINGS'][$szFieldId];
$myDBQueryFieldName = $myDBFieldName;
$mySelectFieldName = $myDBFieldName;
// Special handling for date fields
if ( $nFieldType == FILTER_TYPE_DATE )
{
// Helper variable for the select statement
$mySelectFieldName = $mySelectFieldName . "grouped";
$myDBQueryFieldName = "DATE( " . $myDBFieldName . ") AS " . $mySelectFieldName ;
//$orderBy = $mySelectFieldName." DESC";
}
// Create SQL Where Clause!
@ -1307,7 +1317,7 @@ class LogStreamDB extends LogStream {
" FROM `" . $this->_logStreamConfigObj->DBTableName . "`" .
$this->_SQLwhereClause .
" GROUP BY " . $mySelectFieldName .
" ORDER BY totalcount DESC" .
" ORDER BY ".$orderBy.
" LIMIT " . $nRecordLimit;
// Perform Database Query
@ -1346,7 +1356,7 @@ class LogStreamDB extends LogStream {
/*
* ============= Beginn of private functions =============
* ============= Begin of private functions =============
*/
/*
@ -1357,6 +1367,11 @@ class LogStreamDB extends LogStream {
{
if ( $this->_filters != null )
{
//if filter limit set, then apply it to a query
if( isset($this->_filters['limit']) ){
$this->_SQLcustomLimitHaltSearchAfter= $this->_filters['limit'][FILTER_VALUE];
}
global $dbmapping;
$szTableType = $this->_logStreamConfigObj->DBTableType;
@ -1365,6 +1380,7 @@ class LogStreamDB extends LogStream {
// --- Build Query Array
$arrayQueryProperties = $this->_arrProperties;
//"<pre>".$arrayQueryProperties."</pre><br>"
if ( isset($this->_arrFilterProperties) && $this->_arrFilterProperties != null)
{
foreach ( $this->_arrFilterProperties as $filterproperty )
@ -1373,8 +1389,9 @@ class LogStreamDB extends LogStream {
$arrayQueryProperties[] = $filterproperty;
}
}
// ---
// ---
//echo 'DEBUG <pre>'; print_r($arrayQueryProperties); echo '</pre>';
//echo 'DEBUG <pre>'; print_r($this->_filters); echo '</pre>';
// Loop through all available properties
foreach( $arrayQueryProperties as $propertyname )
{
@ -1493,28 +1510,36 @@ class LogStreamDB extends LogStream {
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_DATE;
}
//FIXME keep for backward compatibility
if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTX )
{
// Get current timestamp
$nNowTimeStamp = time();
{
// Get current timestamp
$nNowTimeStamp = time();
if ( $myfilter[FILTER_VALUE] == 1 /*DATE_LASTX_HOUR*/ )
$nNowTimeStamp -= 60 * 60; // One Hour!
else if ( $myfilter[FILTER_VALUE] == 2 /*DATE_LASTX_12HOURS*/)
$nNowTimeStamp -= 60 * 60 * 12; // 12 Hours!
else if ( $myfilter[FILTER_VALUE] == 3 /*DATE_LASTX_24HOURS*/ )
$nNowTimeStamp -= 60 * 60 * 24; // 24 Hours!
else if ( $myfilter[FILTER_VALUE] == 4 /*DATE_LASTX_7DAYS*/ )
$nNowTimeStamp -= 60 * 60 * 24 * 7; // 7 days
else if ( $myfilter[FILTER_VALUE] == 5 /*DATE_LASTX_31DAYS*/ )
$nNowTimeStamp -= 60 * 60 * 24 * 31; // 31 days
else
{
// Set filter to unknown and Abort in this case!
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_UNKNOWN;
break;
}
// Append filter
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType]['DBMAPPINGS'][$propertyname] . " > '" . date("Y-m-d H:i:s", $nNowTimeStamp) . "'";
}
else if ( $myfilter[FILTER_DATEMODE] == DATEMODE_LASTXX )
{//handle x as hours
// Calculate offset timestamp
$nNowTimeStamp = time() - (60 * 60 * floatval($myfilter[FILTER_VALUE]));
if ( $myfilter[FILTER_VALUE] == DATE_LASTX_HOUR )
$nNowTimeStamp -= 60 * 60; // One Hour!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_12HOURS )
$nNowTimeStamp -= 60 * 60 * 12; // 12 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_24HOURS )
$nNowTimeStamp -= 60 * 60 * 24; // 24 Hours!
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_7DAYS )
$nNowTimeStamp -= 60 * 60 * 24 * 7; // 7 days
else if ( $myfilter[FILTER_VALUE] == DATE_LASTX_31DAYS )
$nNowTimeStamp -= 60 * 60 * 24 * 31; // 31 days
else
{
// Set filter to unknown and Abort in this case!
$tmpfilters[$propertyname][FILTER_TYPE] = FILTER_TYPE_UNKNOWN;
break;
}
// Append filter
$tmpfilters[$propertyname][FILTER_VALUE] .= $dbmapping[$szTableType]['DBMAPPINGS'][$propertyname] . " > '" . date("Y-m-d H:i:s", $nNowTimeStamp) . "'";
}
@ -1553,7 +1578,6 @@ class LogStreamDB extends LogStream {
}
}
}
// Check and combine all filters now!
if ( isset($tmpfilters) )
{
@ -1585,8 +1609,11 @@ class LogStreamDB extends LogStream {
}
}
}
// echo $this->_SQLwhereClause;
// print direct debug only on search page
//if(strpos($_SERVER['REQUEST_URI'], "export.php") === false && strpos($_SERVER['REQUEST_URI'], "chartgenerator.php") === false){
// echo "DEBUG: ".$this->_SQLwhereClause."<br>";
//}
//$dbmapping[$szTableType][SYSLOG_UID]
}
else // No filters means nothing to do!
@ -1675,9 +1702,14 @@ class LogStreamDB extends LogStream {
$szSql = $this->CreateSQLStatement($uID);
// --- Append LIMIT
$szSql .= " LIMIT " . $this->_logStreamConfigObj->RecordsPerQuery;
// Override default value if custom is less - act as tail without paging
$limit = $this->_SQLcustomLimitHaltSearchAfter;
if ( isset($limit) === true && ($limit < $this->_logStreamConfigObj->RecordsPerQuery)){
$szSql .= " LIMIT " . $limit;
}else
$szSql .= " LIMIT " . $this->_logStreamConfigObj->RecordsPerQuery;
// ---
// Perform Database Query
$this->_myDBQuery = mysqli_query($this->_dbhandle, $szSql);
if ( !$this->_myDBQuery )

View File

@ -117,7 +117,7 @@ if ( isset($_GET['direction']) )
}
// Read filter property in
if ( isset($_POST['filter']) )
if ( isset($_POST['filter']) )
$myfilter = $_POST['filter'];
else if ( isset($_GET['filter']) )
$myfilter = $_GET['filter'];

View File

@ -245,7 +245,7 @@ if ( !$content['error_occured'] )
// Now handle fields types differently
if ( $content['fields'][$mycolkey]['FieldType'] == FILTER_TYPE_DATE )
{
$content['syslogmessages'][$counter][$mycolkey]['fieldvalue'] = GetFormatedDate($logArray[$mycolkey]);
$content['syslogmessages'][$counter][$mycolkey]['fieldvalue'] = GetFormatedDate($logArray[$mycolkey], true);
}
else if ( $content['fields'][$mycolkey]['FieldType'] == FILTER_TYPE_NUMBER )
{
@ -333,28 +333,33 @@ else
$szOutputFileName = "ExportMessages";
$szOutputFileExtension = ".txt";
if ( $content['exportformat'] == EXPORT_CVS )
{
$szOPFieldSeparator = " ";
$szOPFirstLineFieldNames = true;
$szOPQuoteValues = false;
if( $content['exportformat'] == EXPORT_CVS ){
// Set MIME TYPE and File Extension
$szOutputMimeType = "text/csv";
$szOutputFileExtension = ".csv";
$szOutputMimeType = "text/csv";
$szOutputFileExtension = ".csv";
$szOPFieldSeparator = ",";
$szOPQuoteValues = true;
}
// Set Column line in cvs file!
foreach($content['Columns'] as $mycolkey)
{
if ( isset($fields[$mycolkey]) )
if ( $content['exportformat'] == EXPORT_CVS || $content['exportformat'] == EXPORT_PLAIN) {
if($szOPFirstLineFieldNames === true){
foreach($content['Columns'] as $mycolkey)
{
// Prepend Comma if needed
if (strlen($szOutputContent) > 0)
$szOutputContent .= ",";
if ( isset($fields[$mycolkey]) )
{
// Prepend Comma if needed
if (strlen($szOutputContent) > 0) $szOutputContent .= $szOPFieldSeparator;
// Append column name
$szOutputContent .= $fields[$mycolkey]['FieldCaption'];
// Append column name
$szOutputContent .= $fields[$mycolkey]['FieldCaption'];
}
}
}
// Append line break
$szOutputContent .= "\n";
$szOutputContent .= "\n";
}
// Append messages into output
foreach ( $content['syslogmessages'] as $myIndex => $mySyslogMessage )
@ -364,19 +369,23 @@ else
// --- Process columns
foreach($mySyslogMessage as $myColkey => $mySyslogField)
{
// Prepend Comma if needed
if (strlen($szLine) > 0)
$szLine .= ",";
// Prepend separator if needed
if (strlen($szLine) > 0) $szLine .= $szOPFieldSeparator;
// Append field contents
$szLine .= '"' . str_replace('"', '\\"', $mySyslogField['fieldvalue']) . '"';
if($szOPQuoteValues === true) {
$szLine .= '"' . str_replace('"', '\\"', $mySyslogField['fieldvalue']) . '"';
}else{
$szLine .= $mySyslogField['fieldvalue'];
}
}
// ---
// ---
// Append line!
$szOutputContent .= $szLine . "\n";
}
}
}
else if ( $content['exportformat'] == EXPORT_XML )
{
// Set MIME TYPE and File Extension

View File

@ -80,6 +80,9 @@ $CFG['MiscMaxExecutionTime'] = 30; // LogAnalyzer will try to overwrite the de
$CFG['DebugUserLogin'] = 0; // if enabled, you will see additional informations on failed logins
// ---
// --- Default Export options
$CFG['ExportUseTodayYesterday'] = 0; // Same as ViewUseTodayYesterday. By default export normal dates
// --- Default Frontend Options
$CFG['PrependTitle'] = ""; // If set, this text will be prepended withint the title tag
$CFG['ViewUseTodayYesterday'] = 1; // If enabled, the date from today and yesterday is displayed as "today" and "yesterday"
@ -92,6 +95,9 @@ $CFG['ViewDefaultTheme'] = "default"; // This sets the default theme the user i
$CFG['ViewDefaultLanguage'] = "en"; // Sets the default display language
$CFG['ViewEnableAutoReloadSeconds'] = 0; // If "ViewEnableAutoReloadSeconds" is set to anything higher the 0 (which means disabled), this means auto reload is enabled by default.
$CFG['Default_AUTORELOAD_ID'] = 0; // By default disable autoreload (select id, 1 for user-defined)
$CFG['SESSION_MAXIMIZED'] = 0; // If enabled start session in maximized mode
$CFG['SearchCustomButtonCaption'] = "I'd like to feel sad"; // Default caption for the custom fast search button
$CFG['SearchCustomButtonSearch'] = "error"; // Default search string for the custom search button
@ -124,11 +130,11 @@ $CFG['DefaultViewsID'] = "";
// --- Predefined Searches!
$CFG['Search'][] = array ( "DisplayName" => "Syslog Warnings and Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3%2C4&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "Syslog Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from the last hour", "SearchQuery" => "filter=datelastx%3A1&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 12 hours", "SearchQuery" => "filter=datelastx%3A2&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 24 hours", "SearchQuery" => "filter=datelastx%3A3&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 7 days", "SearchQuery" => "filter=datelastx%3A4&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "SearchQuery" => "filter=datelastx%3A5&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from the last hour", "SearchQuery" => "filter=datelastxx%3A1&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 12 hours", "SearchQuery" => "filter=datelastxx%3A12&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 24 hours", "SearchQuery" => "filter=datelastxx%3A24&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 7 days", "SearchQuery" => "filter=datelastxx%3A168&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "SearchQuery" => "filter=datelastxx%3A744&search=Search" );
// $CFG['Search'][] = array ( "DisplayName" => "", "SearchQuery" => "" );
// ---

View File

@ -47,15 +47,16 @@ if ( !defined('IN_PHPLOGCON') )
define('DATEMODE_ALL', 1);
define('DATEMODE_RANGE', 2);
define('DATEMODE_LASTX', 3);
define('DATEMODE_LASTXX', 33);
define('DATEMODE_RANGE_FROM', 4);
define('DATEMODE_RANGE_TO', 5);
define('DATEMODE_RANGE_DATE', 6);
define('DATE_LASTX_HOUR', 1);
define('DATE_LASTX_12HOURS', 2);
define('DATE_LASTX_24HOURS', 3);
define('DATE_LASTX_7DAYS', 4);
define('DATE_LASTX_31DAYS', 5);
define('DATE_LASTX_12HOURS', 12);
define('DATE_LASTX_24HOURS', 24);
define('DATE_LASTX_7DAYS', 168);
define('DATE_LASTX_31DAYS', 744);
// ---
@ -109,6 +110,8 @@ $content['filter_severity_list'][] = array( "ID" => SYSLOG_WARNING, "DisplayName
$content['filter_severity_list'][] = array( "ID" => SYSLOG_NOTICE, "DisplayName" => "NOTICE", "selected" => "" );
$content['filter_severity_list'][] = array( "ID" => SYSLOG_INFO, "DisplayName" => "INFO", "selected" => "" );
$content['filter_severity_list'][] = array( "ID" => SYSLOG_DEBUG, "DisplayName" => "DEBUG", "selected" => "" );
$content['filter_severity_list'][] = array( "ID" => CUSTOM_TRACE, "DisplayName" => "TRACE", "selected" => "" );
// ---
// Init MessageType LIST
@ -118,4 +121,4 @@ $content['filter_messagetype_list'][] = array( "ID" => IUT_NT_EventReport, "Disp
$content['filter_messagetype_list'][] = array( "ID" => IUT_File_Monitor, "DisplayName" => "File Monitor", "selected" => "" );
$content['filter_messagetype_list'][] = array( "ID" => IUT_WEBSERVERLOG, "DisplayName" => "Webserver Logfile", "selected" => "" );
?>
?>

View File

@ -76,6 +76,7 @@ define('SOURCE_CLICKHOUSE', '5');
// ---
// --- Exportformat defines
define('EXPORT_PLAIN', 'TXT');
define('EXPORT_CVS', 'CVS');
define('EXPORT_XML', 'XML');
// ---
@ -169,6 +170,8 @@ define('SYSLOG_WARNING', 4);
define('SYSLOG_NOTICE', 5);
define('SYSLOG_INFO', 6);
define('SYSLOG_DEBUG', 7);
define('CUSTOM_TRACE', 8);
$severity_colors[SYSLOG_EMERG] = "#840A15";
$severity_colors[SYSLOG_ALERT] = "#BA0716";
$severity_colors[SYSLOG_CRIT] = "#CE0819";
@ -177,6 +180,8 @@ $severity_colors[SYSLOG_WARNING] = "#EF8200";
$severity_colors[SYSLOG_NOTICE] = "#14AD42";
$severity_colors[SYSLOG_INFO] = "#0C9C91";
$severity_colors[SYSLOG_DEBUG] = "#119BDE";
$severity_colors[CUSTOM_TRACE] = "#C0C381";
// ---
// --- MonitorWare InfoUnit Defines | Messagetypes

View File

@ -0,0 +1,7 @@
-- New Database Structure Updates
ALTER TABLE `logcon_charts` ADD `chart_orderby` VARCHAR( 255 ) NULL AFTER `chart_defaultfilter` ;
-- Insert data
-- Updated Data

View File

@ -510,6 +510,8 @@ function CreateReloadTimesList()
$tmpReloadSeconds = GetConfigSetting("ViewEnableAutoReloadSeconds", "", CFGLEVEL_USER);
if ( $tmpReloadSeconds > 0 )
{
//by default select predefined value
$_SESSION['AUTORELOAD_ID'] = GetConfigSetting("Default_AUTORELOAD_ID", 0, CFGLEVEL_USER);
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => $content['LN_AUTORELOAD_PRECONFIGURED'] . " (" . $tmpReloadSeconds . " " . $content['LN_AUTORELOAD_SECONDS'] . ") ", "Value" => $tmpReloadSeconds ); $iCounter++;
}
$content['reloadtimes'][$iCounter] = array( "ID" => $iCounter, "Selected" => "", "DisplayName" => " 5 " . $content['LN_AUTORELOAD_SECONDS'], "Value" => 5 ); $iCounter++;
@ -535,6 +537,7 @@ function CreateExportFormatList()
global $content;
// Add basic formats!
$content['EXPORTTYPES'][EXPORT_PLAIN] = array( "ID" => EXPORT_PLAIN, "Selected" => "", "DisplayName" => $content['LN_GEN_EXPORT_PLAIN'] );
$content['EXPORTTYPES'][EXPORT_CVS] = array( "ID" => EXPORT_CVS, "Selected" => "", "DisplayName" => $content['LN_GEN_EXPORT_CVS'] );
$content['EXPORTTYPES'][EXPORT_XML] = array( "ID" => EXPORT_XML, "Selected" => "", "DisplayName" => $content['LN_GEN_EXPORT_XML'] );
@ -1796,6 +1799,9 @@ function SaveGeneralSettingsIntoDB($bForceStripSlahes = false)
WriteConfigValue( "ViewDefaultLanguage", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewDefaultTheme", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ExportUseTodayYesterday", true, null, null,$bForceStripSlahes );
WriteConfigValue( "SESSION_MAXIMIZED", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewUseTodayYesterday", true, null, null,$bForceStripSlahes );
WriteConfigValue( "ViewEnableDetailPopups", true, null, null,$bForceStripSlahes );
WriteConfigValue( "EnableContextLinks", true, null, null,$bForceStripSlahes );
@ -1818,6 +1824,7 @@ function SaveGeneralSettingsIntoDB($bForceStripSlahes = false)
WriteConfigValue( "PrependTitle", true, null, null,$bForceStripSlahes );
WriteConfigValue( "SearchCustomButtonCaption", true, null, null,$bForceStripSlahes );
WriteConfigValue( "SearchCustomButtonSearch", true, null, null,$bForceStripSlahes );
WriteConfigValue( "EventEmptySearchDefaultFilter", true, null, null,$bForceStripSlahes );
// Extra Fields
WriteConfigValue( "DefaultViewsID", true, null, null,$bForceStripSlahes );
@ -1847,6 +1854,9 @@ function SaveUserGeneralSettingsIntoDB()
WriteConfigValue( "ViewDefaultLanguage", false, $content['SESSION_USERID']);
WriteConfigValue( "ViewDefaultTheme", false, $content['SESSION_USERID'] );
WriteConfigValue( "ExportUseTodayYesterday", false, $content['SESSION_USERID']);
WriteConfigValue( "SESSION_MAXIMIZED", false, $content['SESSION_USERID']);
WriteConfigValue( "ViewUseTodayYesterday", false, $content['SESSION_USERID'] );
WriteConfigValue( "ViewEnableDetailPopups", false, $content['SESSION_USERID'] );
WriteConfigValue( "EnableContextLinks", false, $content['SESSION_USERID'] );
@ -1869,7 +1879,8 @@ function SaveUserGeneralSettingsIntoDB()
WriteConfigValue( "PrependTitle", false, $content['SESSION_USERID'] );
WriteConfigValue( "SearchCustomButtonCaption", false, $content['SESSION_USERID'] );
WriteConfigValue( "SearchCustomButtonSearch", false, $content['SESSION_USERID'] );
WriteConfigValue( "EventEmptySearchDefaultFilter", false, $content['SESSION_USERID'] );
// Extra Fields
WriteConfigValue( "DefaultViewsID", false, $content['SESSION_USERID'] );
WriteConfigValue( "DefaultSourceID", false, $content['SESSION_USERID'] );

View File

@ -930,7 +930,8 @@ function LoadChartsFromDatabase()
DB_CHARTS . ".chart_enabled, " .
DB_CHARTS . ".chart_type, " .
DB_CHARTS . ".chart_width, " .
DB_CHARTS . ".chart_field, " .
DB_CHARTS . ".chart_field, " .
DB_CHARTS . ".chart_orderby, " .
DB_CHARTS . ".chart_defaultfilter, " .
DB_CHARTS . ".maxrecords, " .
DB_CHARTS . ".showpercent, " .

View File

@ -60,9 +60,9 @@ function InitFilterHelpers()
$content['datemodes'][1]['ID'] = DATEMODE_RANGE;
$content['datemodes'][1]['DisplayName'] = $content['LN_DATEMODE_RANGE'];
if ( $filters['filter_datemode'] == DATEMODE_RANGE ) { $content['datemodes'][1]['selected'] = "selected"; } else { $content['datemodes'][1]['selected'] = ""; }
$content['datemodes'][2]['ID'] = DATEMODE_LASTX;
$content['datemodes'][2]['ID'] = DATEMODE_LASTXX;
$content['datemodes'][2]['DisplayName'] = $content['LN_DATEMODE_LASTX'];
if ( $filters['filter_datemode'] == DATEMODE_LASTX ) { $content['datemodes'][2]['selected'] = "selected"; } else { $content['datemodes'][2]['selected'] = ""; }
if ( $filters['filter_datemode'] == DATEMODE_LASTXX ) { $content['datemodes'][2]['selected'] = "selected"; } else { $content['datemodes'][2]['selected'] = ""; }
// Init Date Range Parameters
global $currentTime, $currentDay, $currentMonth, $currentYear, $tomorrowTime, $tomorrowDay, $tomorrowMonth, $tomorrowYear;
@ -237,7 +237,7 @@ function InitFilterHelpers()
if ( isset($_SESSION['filter_severity']) )
$filters['filter_severity'] = intval($_SESSION['filter_severity']);
else
$filters['filter_severity'] = array ( SYSLOG_EMERG, SYSLOG_ALERT, SYSLOG_CRIT, SYSLOG_ERR, SYSLOG_WARNING, SYSLOG_NOTICE, SYSLOG_INFO, SYSLOG_DEBUG );
$filters['filter_severity'] = array ( SYSLOG_EMERG, SYSLOG_ALERT, SYSLOG_CRIT, SYSLOG_ERR, SYSLOG_WARNING, SYSLOG_NOTICE, SYSLOG_INFO, SYSLOG_DEBUG, CUSTOM_TRACE );
$iCount = count($content['filter_severity_list']);
for ( $i = 0; $i < $iCount; $i++ )
@ -363,4 +363,4 @@ function GetDateTimeDetailsFromTimeString($szTimeString, &$second, &$minute, &$h
return false;
}
?>
?>

View File

@ -220,17 +220,19 @@ function CreateCurrentUrl()
// done
}
function GetFormatedDate($evttimearray)
function GetFormatedDate($evttimearray, $onExport = false)
{
global $content;
if ( is_array($evttimearray) )
{
if (
GetConfigSetting("ViewUseTodayYesterday", 0, CFGLEVEL_USER) == 1
&&
( date('m', $evttimearray[EVTIME_TIMESTAMP]) == date('m') && date('Y', $evttimearray[EVTIME_TIMESTAMP]) == date('Y') )
)
($onExport == true && GetConfigSetting("ExportUseTodayYesterday", 0, CFGLEVEL_USER) == 1)
|| (
$onExport == false && GetConfigSetting("ViewUseTodayYesterday", 0, CFGLEVEL_USER) == 1
&& ( date('m', $evttimearray[EVTIME_TIMESTAMP]) == date('m') && date('Y', $evttimearray[EVTIME_TIMESTAMP]) == date('Y') )
)
)
{
if ( date('d', $evttimearray[EVTIME_TIMESTAMP]) == date('d') )
return "Today " . date("H:i:s", $evttimearray[EVTIME_TIMESTAMP] );

View File

@ -122,11 +122,14 @@ $content['main_pager_last_found'] = false;
// Init Sorting variables
$content['sorting'] = "";
$content['searchstr'] = "";
$content['searchstr_htmlform'] = "";
$content['searchstr_htmlform'] = GetConfigSetting("EventEmptySearchDefaultFilter", "", CFGLEVEL_USER);
$content['highlightstr'] = "";
$content['highlightstr_htmlform'] = "";
$content['EXPAND_HIGHLIGHT'] = "false";
// Control header visibility
$_SESSION['SESSION_MAXIMIZED'] = GetConfigSetting("SESSION_MAXIMIZED", 0, CFGLEVEL_USER);
// --- Read and process filters from search dialog!
if ( (isset($_POST['search']) || isset($_GET['search'])) || (isset($_POST['filter']) || isset($_GET['filter'])) )
{
@ -202,7 +205,6 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) || (isset($_POST['filte
}
}
// ---
// --- BEGIN CREATE TITLE
$content['TITLE'] = InitPageTitle();
@ -215,6 +217,10 @@ else
// --- BEGIN Custom Code
//by default limit search to some sane range
if (empty($content['searchstr'])){
$content['searchstr'] = $content['searchstr_htmlform'];
}
// Do not BLOCK other Site Calls
WriteClosePHPSession();
@ -365,9 +371,9 @@ if ( isset($content['Sources'][$currentSourceID]) )
// --- Set CSS Class
if ( $counter % 2 == 0 )
$content['syslogmessages'][$counter]['cssclass'] = "line1";
$content['syslogmessages'][$counter]['cssclass'] = "line1" . (isset($logArray[SYSLOG_SEVERITY]) && strlen($logArray[SYSLOG_SEVERITY]) > 0 ? "_" . $logArray[SYSLOG_SEVERITY] : "");
else
$content['syslogmessages'][$counter]['cssclass'] = "line2";
$content['syslogmessages'][$counter]['cssclass'] = "line2" . (isset($logArray[SYSLOG_SEVERITY]) && strlen($logArray[SYSLOG_SEVERITY]) > 0 ? "_" . $logArray[SYSLOG_SEVERITY] : "");
// ---
// --- Copy other needed properties

View File

@ -1,8 +1,8 @@
/*
Helper Javascript Constants
*/
const DATEMODE_ALL = 1, DATEMODE_RANGE = 2, DATEMODE_LASTX = 3;
const DATE_LASTX_HOUR = 1, DATE_LASTX_12HOURS = 2, DATE_LASTX_24HOURS = 3, DATE_LASTX_7DAYS = 4,DATE_LASTX_31DAYS = 5;
const DATEMODE_ALL = 1, DATEMODE_RANGE = 2, DATEMODE_LASTXX = 33;
const DATE_LASTX_HOUR = 1, DATE_LASTX_12HOURS = 12, DATE_LASTX_24HOURS = 24, DATE_LASTX_7DAYS = 168, DATE_LASTX_31DAYS = 744;
/*
Helper Javascript functions
@ -54,7 +54,7 @@ function toggleDatefiltervisibility(FormName)
toggleformelement('filter_daterange_last_x', false);
}
else if (myform.elements['filter_datemode'].value == DATEMODE_LASTX)
else if (myform.elements['filter_datemode'].value == DATEMODE_LASTXX)
{
togglevisibility('HiddenDateLastXOptions');
hidevisibility('HiddenDateFromOptions');
@ -99,9 +99,9 @@ function CalculateSearchPreview(szSearchFormName, szPreviewArea)
+ mySearchform.elements['filter_daterange_to_minute'].value + ":"
+ mySearchform.elements['filter_daterange_to_second'].value + " ";
}
else if (mySearchform.elements['filter_datemode'].value == DATEMODE_LASTX)
else if (mySearchform.elements['filter_datemode'].value == DATEMODE_LASTXX)
{
szOutString += "datelastx:" + mySearchform.elements['filter_daterange_last_x'].value + " ";
szOutString += "datelastxx:" + mySearchform.elements['filter_daterange_last_x'].value + " ";
}
// --- Syslog Facility

View File

@ -87,6 +87,7 @@ $content['LN_GEN_ADMINCHANGEWAITTIME'] = "Reloadtime in Adminpanel";
$content['LN_GEN_IPADRRESOLVE'] = "Resolve IP Addresses using DNS";
$content['LN_GEN_CUSTBTNCAPT'] = "Custom search caption";
$content['LN_GEN_CUSTBTNSRCH'] = "Custom search string";
$content['LN_GEN_EMPTYSRCHFILTR'] = "Override empty search filter";
$content['LN_GEN_SUCCESSFULLYSAVED'] = "The configuration Values have been successfully saved";
$content['LN_GEN_INTERNAL'] = "Internal";
$content['LN_GEN_DISABLED'] = "Function disabled";
@ -104,6 +105,7 @@ $content['LN_GEN_GLOBALVALUE'] = "Global value";
$content['LN_GEN_PERSONALVALUE'] = "Personal (User)value";
$content['LN_GEN_DISABLEUSEROPTIONS'] = "Click here to disable personal options";
$content['LN_GEN_ENABLEUSEROPTIONS'] = "Click here to enable personal options";
$content['LN_GEN_EXPORT_USETODAY'] = "Use Today and Yesterday in timefields of export";
$content['LN_ADMIN_GLOBALONLY'] = "Global Options Only";
$content['LN_GEN_DEBUGTOSYSLOG'] = "Send Debug to local syslog server";
$content['LN_GEN_POPUPMENUTIMEOUT'] = "Popupmenu Timeout in milli seconds";
@ -118,6 +120,7 @@ $content['LN_ADMIN_USEPROXYSERVER'] = "Leave empty if you do not want to use a p
$content['LN_ADMIN_DEFAULTENCODING'] = "Default character encoding";
$content['LN_GEN_CONTEXTLINKS'] = "Enable Contextlinks (Question marks)";
$content['LN_GEN_DISABLEADMINUSERS'] = "Disable Adminpanel for normal users";
$content['LN_GEN_SESSION_MAX'] = "Load page in maximized mode";
// User Center
$content['LN_USER_CENTER'] = "User Options";

View File

@ -86,6 +86,7 @@ $content['LN_GEN_SELECTEXPORT'] = "&gt; Select Exportformat &lt;";
$content['LN_GEN_EXPORT_CVS'] = "CSV (Comma separated)";
$content['LN_GEN_EXPORT_XML'] = "XML";
$content['LN_GEN_EXPORT_PDF'] = "PDF";
$content['LN_GEN_EXPORT_PLAIN'] = "Plain TXT";
$content['LN_GEN_ERROR_EXPORING'] = "Error exporting data";
$content['LN_GEN_ERROR_INVALIDEXPORTTYPE'] = "Invalid Export format selected, or other parameters were wrong.";
$content['LN_GEN_ERROR_SOURCENOTFOUND'] = "The Source with ID '%1' could not be found.";
@ -337,6 +338,8 @@ $content['LN_CONVERT_ERROR_SOURCEIMPORT'] = "Critical Error while importing the
$content['LN_CHART_TYPE'] = "Chart type";
$content['LN_CHART_WIDTH'] = "Chart width";
$content['LN_CHART_FIELD'] = "Chart field";
$content['LN_CHART_FILTER'] = "SQL Query filter";
$content['LN_CHART_ORDERBY'] = "SQL ORDER BY";
$content['LN_CHART_MAXRECORDS'] = "Top records count";
$content['LN_CHART_SHOWPERCENT'] = "Show percentage data";
$content['LN_CHART_TYPE_CAKE'] = "Cake (Pie)";

View File

@ -149,12 +149,12 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) )
$filters['filter_daterange_to_second'] . " ";
}
else if ( $filters['filter_datemode'] == DATEMODE_LASTX )
else if ( $filters['filter_datemode'] == DATEMODE_LASTXX )
{
if ( isset($_GET['filter_daterange_last_x']) )
{
$filters['filter_daterange_last_x'] = intval($_GET['filter_daterange_last_x']);
$content['searchstr'] .= "datelastx:" . $filters['filter_daterange_last_x'] . " ";
$content['searchstr'] .= "datelastxx:" . $filters['filter_daterange_last_x'] . " ";
}
}
}

View File

@ -110,6 +110,12 @@ if ( isset($content['Charts']) )
$myChart['chart_defaultfilter_urldecoded'] = urlencode($myChart['chart_defaultfilter']);
else
$myChart['chart_defaultfilter_urldecoded'] = "";
if ( isset($myChart['chart_orderby']) && strlen($myChart['chart_orderby']) > 0 )
$myChart['chart_orderby_urldecoded'] = urlencode($myChart['chart_orderby']);
else
$myChart['chart_orderby_urldecoded'] = "";
// ---
// --- Set CSS Class
@ -159,4 +165,4 @@ $page -> output();
//include($gl_root_path . 'include/functions_installhelpers.php');
//ConvertCustomCharts();
?>
?>

View File

@ -68,7 +68,7 @@
&nbsp;<a href="#" id="dialog-chart_{ID}"><img src="{MENU_CHART_PREVIEW}" width="16" title="{LN_CHARTS_PREVIEW}"></a>
<script> $( "#dialog-chart_{ID}" ).click(function( event ) {
$( "#dialog").html('<center></br><img src="{BASEPATH}images/ajax-loader.gif"></br></br></center>');
$( "#dialog").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}&basepath={BASEPATH}');
$( "#dialog").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&orderby={chart_orderby_urldecoded}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}&basepath={BASEPATH}');
$( "#dialog").dialog("option","position",$("#dialog").dialog("option","position"));
$( "#dialog").dialog( {title: "Chartgenerator"});
$( "#dialog").dialog( "open" );
@ -119,6 +119,11 @@
</select>
</td>
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CHART_ORDERBY}</b></td>
<td align="left" class="line1"><input type="text" name="chart_orderby" size="55" maxlength="255" value='{chart_orderby}' class="maxwidth"></td>
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CHART_WIDTH}</b></td>
<td align="left" class="line1"><input type="text" name="chart_width" size="55" maxlength="255" value="{chart_width}" class="maxwidth"></td>
@ -133,7 +138,7 @@
</tr>
<tr>
<td align="left" class="cellmenu2_naked" valign="top" nowrap><b>{LN_CHARTS_FILTERSTRING}</b></td>
<td align="left" class="line1"><font class="ErrorMsg">{LN_CHARTS_FILTERSTRING_HELP}</font></br><input type="text" name="chart_defaultfilter" size="100" maxlength="1024" value="{chart_defaultfilter}" class="maxwidth"></td>
<td align="left" class="line1"><font class="ErrorMsg">{LN_CHARTS_FILTERSTRING_HELP}</font></br><input type="text" name="chart_defaultfilter" size="100" maxlength="1024" value='{chart_defaultfilter}' class="maxwidth"></td>
</tr>
<tr>
@ -201,4 +206,4 @@ $(window).resize(function() {
*/
</script>
<!-- INCLUDE include_footer.html -->
<!-- INCLUDE include_footer.html -->

View File

@ -228,6 +228,14 @@
<td align="left" class="line1" ><input type="text" name="User_SearchCustomButtonSearch" size="35" maxlength="255" value="{User_SearchCustomButtonSearch}" class="maxwidth"></td>
<!-- ENDIF ENABLEUSEROPTIONS="true" -->
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_GEN_EMPTYSRCHFILTR}</b></td>
<td align="left" class="line1" ><input type="text" name="EventEmptySearchDefaultFilter" size="35" maxlength="255" value="{EventEmptySearchDefaultFilter}" {DISABLE_GLOBALEDIT_FORMCONTROL} class="maxwidth"></td>
<!-- IF ENABLEUSEROPTIONS="true" -->
<td align="left" class="line1" ><input type="text" name="User_EventEmptySearchDefaultFilter" size="35" maxlength="255" value="{User_EventEmptySearchDefaultFilter}" class="maxwidth"></td>
<!-- ENDIF ENABLEUSEROPTIONS="true" -->
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_GEN_USETODAY}</b></td>
<td align="left" class="line2" ><input type="checkbox" name="ViewUseTodayYesterday" value="yes" {ViewUseTodayYesterday_checked} {DISABLE_GLOBALEDIT_FORMCONTROL}></td>
@ -235,6 +243,22 @@
<td align="left" class="line2" ><input type="checkbox" name="User_ViewUseTodayYesterday" value="yes" {User_ViewUseTodayYesterday_checked}></td>
<!-- ENDIF ENABLEUSEROPTIONS="true" -->
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_GEN_EXPORT_USETODAY}</b></td>
<td align="left" class="line2" ><input type="checkbox" name="ExportUseTodayYesterday" value="yes" {ExportUseTodayYesterday_checked} {DISABLE_GLOBALEDIT_FORMCONTROL}></td>
<!-- IF ENABLEUSEROPTIONS="true" -->
<td align="left" class="line2" ><input type="checkbox" name="User_ExportUseTodayYesterday" value="yes" {User_ExportUseTodayYesterday_checked}></td>
<!-- ENDIF ENABLEUSEROPTIONS="true" -->
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_GEN_SESSION_MAX}</b></td>
<td align="left" class="line2" ><input type="checkbox" name="SESSION_MAXIMIZED" value="yes" {SESSION_MAXIMIZED_checked} {DISABLE_GLOBALEDIT_FORMCONTROL}></td>
<!-- IF ENABLEUSEROPTIONS="true" -->
<td align="left" class="line2" ><input type="checkbox" name="User_SESSION_MAXIMIZED" value="yes" {User_SESSION_MAXIMIZED_checked}></td>
<!-- ENDIF ENABLEUSEROPTIONS="true" -->
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_GEN_DETAILPOPUPS}</b></td>
<td align="left" class="line1" ><input type="checkbox" name="ViewEnableDetailPopups" value="yes" {ViewEnableDetailPopups_checked} {DISABLE_GLOBALEDIT_FORMCONTROL}></td>

View File

@ -41,7 +41,7 @@
<b>{DisplayName}</b>
<!-- ENDIF ActionsAllowed!="true" -->
</td>
<td align="left" class="{cssclass}"><a href="{BASEPATH}index.php?{SearchQuery}">{SearchQuery_Display}</a></td>
<td align="left" class="{cssclass}"><a href='{BASEPATH}index.php?{SearchQuery}'>{SearchQuery_Display}</a></td>
<td align="left" class="{cssclass}"><img src="{SearchTypeImage}" width="16" align="left"> <b>{SearchTypeText}</b></td>
<td align="center" class="{cssclass}">
@ -74,7 +74,7 @@
</tr>
<tr>
<td align="left" class="cellmenu2"><b>{LN_SEARCH_QUERY}</b></td>
<td align="left" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value="{SearchQuery}" class="maxwidth"></td>
<td align="left" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value='{SearchQuery}' class="maxwidth"></td>
</tr>
<tr>
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>

View File

@ -15,7 +15,7 @@
<button id="openmenu_searches"><span class="ui-icon ui-icon-circle-triangle-s" title="{LN_GEN_PREDEFINEDSEARCHES}"></span></button>
<ul id="menu_searches" style="position:absolute;z-index:99;display:none;">
<!-- BEGIN Search -->
<li><a href="?{SearchQuery}{additional_url_sourceonly}" target="_top">{DisplayName}</a></li>
<li><a href='?{SearchQuery}{additional_url_sourceonly}' target="_top">{DisplayName}</a></li>
<!-- END Search -->
</ul>
<script> CreateMenuFunction( "#openmenu_searches", "#menu_searches", false );</script>

View File

@ -43,6 +43,15 @@
<td class="cellmenu2" nowrap><B>{LN_CHART_FIELD}</B></td>
<td class="line2">&nbsp;{CHART_FIELD_DISPLAYNAME}</td>
</tr>
<tr>
<td class="cellmenu2" nowrap><B>{LN_CHART_ORDERBY}</B></td>
<td class="line2">&nbsp;{chart_orderby}</td>
</tr>
<tr>
<td class="cellmenu2" nowrap><B>{LN_CHART_FILTER}</B></td>
<td class="line2">&nbsp;{chart_defaultfilter}</td>
</tr>
<tr>
<td class="cellmenu2" nowrap><B>{LN_CHART_WIDTH}</B></td>
<td class="line1">&nbsp;{chart_width}</td>
@ -59,7 +68,7 @@
<div id="Chart{CHART_ID}"></div>
<script>
$( "#Chart{CHART_ID}").html('<center></br><img src="images/ajax-loader.gif"></br></br></center>');
$( "#Chart{CHART_ID}").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}');
$( "#Chart{CHART_ID}").load('{BASEPATH}chartgenerator.php?type={chart_type}&byfield={chart_field}&orderby={chart_orderby_urldecoded}&width={chart_width}&maxrecords={maxrecords}&showpercent={showpercent}&defaultfilter={chart_defaultfilter_urldecoded}');
</script>
</td></tr>
</table>
@ -70,4 +79,4 @@
</table>
<!-- ENDIF statsenabled="true" -->
<!-- INCLUDE include_footer.html -->
<!-- INCLUDE include_footer.html -->

View File

@ -23,7 +23,6 @@ a:link,a:active,a:visited,a.postlink
{
font-weight: bold;
text-decoration:none;
background-color: transparent;
color:#005989;
}
@ -34,6 +33,13 @@ a:hover
}
/*---*/
/* Gridline Link Classes */
td .gridline a:link,td .gridline a:active,td .gridline a:visited,td .gridline a.postlink
{
color:#ffffff;
}
/* Context Link Classes */
a.contextlink:link,a.contextlink:active,a.contextlink:visited,a.contextlink
{
@ -157,6 +163,52 @@ font
}
/* Cells for listening */
/*emergency*/
.line1_0 { color: #ffffff; background-color: #840A15;}
.line1_0:hover { background-color:#ed1224;}
.line2_0{ color: #ffffff; background-color: #be0e1d;}
.line2_0:hover {background-color:#f8a0a7; }
/*alert*/
.line1_1 { color: #ffffff; background-color: #BA0716;}
.line1_1:hover { background-color:#f6091d;}
.line2_1{ color: #ffffff; background-color: #dd081a;}
.line2_1:hover {background-color:#fa6b77; }
/*critical*/
.line1_2 { color: #ffffff; background-color: #CE0819;}
.line1_2:hover { background-color:#fa6b77;}
.line2_2{ color: #ffffff; background-color: #f83a4a;}
.line2_2:hover {background-color:#fcb5bb; }
/*error*/
.line1_3 { color: #ffffff; background-color: #BB0A1F;}
.line1_3:hover { background-color:#fa9ea9;}
.line2_3{ color: #ffffff; background-color: #f20d28;}
.line2_3:hover {background-color:#fa9ea9; }
/*warning*/
.line1_4 { color: #000000; background-color: #EF8200;}
.line1_4:hover { background-color:#ffa333;}
.line2_4{ color: #000000; background-color: #ff8c00;}
.line2_4:hover {background-color:#ffc680; }
/*notice*/
.line1_5 { color: #000000; background-color: #14AD42;}
.line1_5:hover { background-color:#32e768;}
.line2_5{ color: #000000; background-color: #18cd4e;}
.line2_5:hover {background-color:#76ef9a; }
/*info*/
.line1_6 { color: #000000; background-color: #0C9C91;}
.line1_6:hover { background-color:#2aefde;}
.line2_6{ color: #000000; background-color: #0ebeaf;}
.line2_6:hover {background-color:#2aefde; }
/*debug*/
.line1_7 { color: #000000; background-color: #666699;}
.line1_7:hover { background-color:#a3a3c2;}
.line2_7{ color: #000000; background-color: #8585ad;}
.line2_7:hover {background-color:#a3a3c2; }
/*trace*/
.line1_8 { color: #000000; background-color: #c2c2c0;}
.line1_8:hover { background-color:#dadad8;}
.line2_8{ color: #000000; background-color: #cdcdcb;}
.line2_8:hover {background-color:#f3f3f2; }
.line0
{
color: #000000;