diff --git a/src/classes/logstreamlineparsersyslog.class.php b/src/classes/logstreamlineparsersyslog.class.php index 0de415f..8bb67e9 100644 --- a/src/classes/logstreamlineparsersyslog.class.php +++ b/src/classes/logstreamlineparsersyslog.class.php @@ -82,6 +82,14 @@ class LogStreamLineParsersyslog extends LogStreamLineParser { $arrArguments[SYSLOG_SYSLOGTAG] = $out[3]; $arrArguments[SYSLOG_MESSAGE] = $out[4]; } + // Sample (Syslog): Mar 7 17:18:35 debandre exiting on signal 15 + else if ( preg_match("/(... [0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?)$/", $szLine, $out ) ) + { + // Copy parsed properties! + $arrArguments[SYSLOG_DATE] = GetEventTime($out[1]); + $arrArguments[SYSLOG_HOST] = $out[2]; + $arrArguments[SYSLOG_MESSAGE] = $out[3]; + } // Sample (RSyslog): 2008-03-28T11:07:40+01:00 localhost rger: test 1 else if ( preg_match("/([0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\+[0-9]{1,2}:[0-9]{1,2}) (.*?) (.*?):(.*?)$/", $szLine, $out ) ) { @@ -107,14 +115,10 @@ class LogStreamLineParsersyslog extends LogStreamLineParser { $arrArguments[SYSLOG_DATE] = GetEventTime($out[1]); $arrArguments[SYSLOG_MESSAGE] = $out[2]; } - else { - if ( strlen($arrArguments[SYSLOG_MESSAGE]) > 0 ) - { - // TODO: Cannot Parse Syslog message with this pattern! - echo ("wtf syslog - '" . $arrArguments[SYSLOG_MESSAGE] . "'
"); - } + if ( isset($arrArguments[SYSLOG_MESSAGE]) && strlen($arrArguments[SYSLOG_MESSAGE]) > 0 ) + OutputDebugMessage("Unparseable syslog msg - '" . $arrArguments[SYSLOG_MESSAGE] . "'"); } // If SyslogTag is set, we check for MessageType! diff --git a/src/classes/logstreamlineparserwinsyslog.class.php b/src/classes/logstreamlineparserwinsyslog.class.php index 90bc72f..35eb8ee 100644 --- a/src/classes/logstreamlineparserwinsyslog.class.php +++ b/src/classes/logstreamlineparserwinsyslog.class.php @@ -75,10 +75,6 @@ class LogStreamLineParserwinsyslog extends LogStreamLineParser { $arrArguments[SYSLOG_SEVERITY] = $out[5]; $arrArguments[SYSLOG_SYSLOGTAG] = $out[6]; $arrArguments[SYSLOG_MESSAGE] = $out[7]; - -// // Expand SYSLOG_FACILITY and SYSLOG_SEVERITY -// $arrArguments[SYSLOG_FACILITY_TEXT] = GetFacilityDisplayName( $arrArguments[SYSLOG_FACILITY] ); -// $arrArguments[SYSLOG_SEVERITY_TEXT] = GetSeverityDisplayName( $arrArguments[SYSLOG_SEVERITY] ); } else if ( preg_match("/([0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2},[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}),([0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2},[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}),(.*?),([0-9]{1,2}),([0-9]{1,2}),(.*?)$/", $szLine, $out ) ) { @@ -88,18 +84,11 @@ class LogStreamLineParserwinsyslog extends LogStreamLineParser { $arrArguments[SYSLOG_FACILITY] = $out[4]; $arrArguments[SYSLOG_SEVERITY] = $out[5]; $arrArguments[SYSLOG_MESSAGE] = $out[6]; - -// // Expand SYSLOG_FACILITY and SYSLOG_SEVERITY -// $arrArguments[SYSLOG_FACILITY_TEXT] = GetFacilityDisplayName( $arrArguments[SYSLOG_FACILITY] ); -// $arrArguments[SYSLOG_SEVERITY_TEXT] = GetSeverityDisplayName( $arrArguments[SYSLOG_SEVERITY] ); } else { - if ( strlen($arrArguments[SYSLOG_MESSAGE]) > 0 ) - { - // TODO: Cannot Parse Syslog message with this pattern! - die ("wtf winsyslog - '" . $arrArguments[SYSLOG_MESSAGE] . "'"); - } + if ( isset($arrArguments[SYSLOG_MESSAGE]) && strlen($arrArguments[SYSLOG_MESSAGE]) > 0 ) + OutputDebugMessage("Unparseable Winsyslog message - '" . $arrArguments[SYSLOG_MESSAGE] . "'"); } // If SyslogTag is set, we check for MessageType! diff --git a/src/config.php b/src/config.php index 4f5ba78..a581908 100644 --- a/src/config.php +++ b/src/config.php @@ -74,6 +74,17 @@ $CFG['Columns'][] = SYSLOG_MESSAGETYPE; $CFG['Columns'][] = SYSLOG_MESSAGE; // --- +// --- 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" => "", "SearchQuery" => "" ); +// --- + // --- Source Options $CFG['Sources'][Source1]['ID'] = "Source1"; $CFG['Sources'][Source1]['Name'] = "Syslog Disk File"; @@ -120,6 +131,6 @@ $CFG['Sources'][Source6]['DBName'] = "syslogng"; $CFG['Sources'][Source6]['DBUser'] = "root"; $CFG['Sources'][Source6]['DBPassword'] = ""; $CFG['Sources'][Source6]['DBTableName'] = "logs"; - // --- -?> + +?> \ No newline at end of file diff --git a/src/css/defaults.css b/src/css/defaults.css index 40a10af..d633a33 100644 --- a/src/css/defaults.css +++ b/src/css/defaults.css @@ -22,6 +22,13 @@ display: none; } +.SelectSavedFilter +{ + margin-top: 3px; + border: 1px solid; + border-color: #233B51 #124A7C #124A7C #233B51; +} + .syslogdetails, a.syslogdetails, a.syslogdetails:link, a.syslogdetails:active, a.syslogdetails:visited { font-weight:normal; @@ -30,13 +37,12 @@ .syslogdetails { position:relative; /*this is the key*/ - z-index:24; + z-index:4; } .syslogdetails:hover { - z-index:25; -/* font-weight:normal;*/ + z-index:5; } .syslogdetails span {display: none} /*the span will display just on :hover state*/ diff --git a/src/css/menu.css b/src/css/menu.css new file mode 100644 index 0000000..c604f23 --- /dev/null +++ b/src/css/menu.css @@ -0,0 +1,55 @@ +#menu { + width: 16px; /* set width of menu */ +} + +#menu ul { /* remove bullets and list indents */ + list-style: none; + margin: 0; + padding: 0; +} + +/* style, color and size links and headings to suit */ +#menu a, #menu h2 { + display: block; + border-width: 1px; + border-style: solid; + margin: 0; + padding: 2px 3px; +} + +#menu h2 { + font: bold 11px/16px; + text-align: center; +} + +#menu a { + text-decoration: none; + border-color: #44617D #203040 #203040 #44617D; +} + +#menu a:hover { + border-style: invert; + text-decoration: none; + border-color: #44617D #203040 #203040 #44617D; +} + +#menu li { + z-index:10; + /* make the list elements a containing block for the nested lists */ + position: relative; +} + +#menu ul ul { + position: absolute; + top: 16px; + left: 0px; /* to position them to the right of their containing block */ + width: 300; /* width is based on the containing block */ +} + +div#menu ul ul, +div#menu ul li:hover ul ul +{display: none;} + +div#menu ul li:hover ul, +div#menu ul ul li:hover ul +{display: block;} \ No newline at end of file diff --git a/src/images/icons/link_view.png b/src/images/icons/link_view.png new file mode 100644 index 0000000..08184bf Binary files /dev/null and b/src/images/icons/link_view.png differ diff --git a/src/images/icons/navigate_check.png b/src/images/icons/navigate_check.png new file mode 100644 index 0000000..8fc0a6a Binary files /dev/null and b/src/images/icons/navigate_check.png differ diff --git a/src/images/icons/navigate_close.png b/src/images/icons/navigate_close.png new file mode 100644 index 0000000..9ae5563 Binary files /dev/null and b/src/images/icons/navigate_close.png differ diff --git a/src/images/icons/navigate_cross.png b/src/images/icons/navigate_cross.png new file mode 100644 index 0000000..4f1e288 Binary files /dev/null and b/src/images/icons/navigate_cross.png differ diff --git a/src/images/icons/navigate_left.png b/src/images/icons/navigate_left.png new file mode 100644 index 0000000..9c39da6 Binary files /dev/null and b/src/images/icons/navigate_left.png differ diff --git a/src/images/icons/navigate_open.png b/src/images/icons/navigate_open.png new file mode 100644 index 0000000..b22b2da Binary files /dev/null and b/src/images/icons/navigate_open.png differ diff --git a/src/images/icons/navigate_right.png b/src/images/icons/navigate_right.png new file mode 100644 index 0000000..2cf8e97 Binary files /dev/null and b/src/images/icons/navigate_right.png differ diff --git a/src/images/icons/navigate_up.png b/src/images/icons/navigate_up.png new file mode 100644 index 0000000..49ce4f2 Binary files /dev/null and b/src/images/icons/navigate_up.png differ diff --git a/src/images/icons/text_find.png b/src/images/icons/text_find.png new file mode 100644 index 0000000..07817d1 Binary files /dev/null and b/src/images/icons/text_find.png differ diff --git a/src/include/constants_logstream.php b/src/include/constants_logstream.php index 21553d2..3aff50f 100644 --- a/src/include/constants_logstream.php +++ b/src/include/constants_logstream.php @@ -86,7 +86,7 @@ $fields[SYSLOG_DATE]['FieldID'] = SYSLOG_DATE; $fields[SYSLOG_DATE]['FieldCaptionID'] = 'LN_FIELDS_DATE'; $fields[SYSLOG_DATE]['FieldType'] = FILTER_TYPE_DATE; $fields[SYSLOG_DATE]['Sortable'] = true; -$fields[SYSLOG_DATE]['DefaultWidth'] = "110"; +$fields[SYSLOG_DATE]['DefaultWidth'] = "115"; $fields[SYSLOG_DATE]['FieldAlign'] = "center"; $fields[SYSLOG_HOST]['FieldID'] = SYSLOG_HOST; $fields[SYSLOG_HOST]['FieldCaptionID'] = 'LN_FIELDS_HOST'; diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 0fb24c9..d6baef7 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -63,7 +63,7 @@ $LANG_EN = "en"; // Used for fallback $LANG = "en"; // Default language // Default Template vars -$content['BUILDNUMBER'] = "2.0.107"; +$content['BUILDNUMBER'] = "2.01.1"; $content['TITLE'] = "PhpLogCon - Release " . $content['BUILDNUMBER']; // Title of the Page $content['BASEPATH'] = $gl_root_path; $content['EXTRA_METATAGS'] = ""; @@ -166,11 +166,42 @@ function InitPhpLogCon() // Create Language List CreateLanguageList(); + // Init Predefined Searches List + CreatePredefinedSearches(); + // --- Enable PHP Debug Mode InitPhpDebugMode(); // --- } +function CreatePredefinedSearches() +{ + global $CFG, $content; + if ( isset($CFG['Search']) ) + { + // Enable predefined searches + $content['EnablePredefinedSearches'] = true; + + // Loop through all predefined searches! + foreach ($CFG['Search'] as $mykey => $mySearch) + { + // Copy configured searches into content array! + $content['Search'][$mykey]["ID"] = $mykey; + $content['Search'][$mykey]["Selected"] = false; + + // --- Set CSS Class + if ( $mykey % 2 == 0 ) + $content['Search'][$mykey]['cssclass'] = "line1"; + else + $content['Search'][$mykey]['cssclass'] = "line2"; + // --- + + } + } + else // Disable predefined searches + $content['EnablePredefinedSearches'] = false; +} + function InitPhpDebugMode() { global $content; @@ -233,6 +264,15 @@ function InitFrontEndVariables() $content['MENU_SEARCH'] = "image=" . $content['BASEPATH'] . "images/icons/view.png"; $content['MENU_SELECTION_DISABLED'] = "image=" . $content['BASEPATH'] . "images/icons/selection.png"; $content['MENU_SELECTION_ENABLED'] = "image=" . $content['BASEPATH'] . "images/icons/selection_delete.png"; + + $content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png"; + $content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png"; + $content['MENU_PAGER_NEXT'] = $content['BASEPATH'] . "images/icons/media_fast_forward.png"; + $content['MENU_PAGER_END'] = $content['BASEPATH'] . "images/icons/media_end.png"; + $content['MENU_NAV_LEFT'] = $content['BASEPATH'] . "images/icons/navigate_left.png"; + $content['MENU_NAV_RIGHT'] = $content['BASEPATH'] . "images/icons/navigate_right.png"; + $content['MENU_NAV_CLOSE'] = $content['BASEPATH'] . "images/icons/navigate_close.png"; + $content['MENU_NAV_OPEN'] = $content['BASEPATH'] . "images/icons/navigate_open.png"; } // Lang Helper for Strings with ONE variable diff --git a/src/include/functions_frontendhelpers.php b/src/include/functions_frontendhelpers.php index 5cfebf6..c889664 100644 --- a/src/include/functions_frontendhelpers.php +++ b/src/include/functions_frontendhelpers.php @@ -145,4 +145,17 @@ function GetFormatedDate($evttimearray) return $szDateFormatted = date("Y-m-d H:i:s", $evttimearray[EVTIME_TIMESTAMP] ); } -?> +function OutputDebugMessage($szDbg) +{ + global $CFG; + + if ( $CFG['MiscShowDebugMsg'] == 1 ) + { + print(""); + print(""); + print(""); + print("
Debugmessage: " . $szDbg . "

"); + } +} + +?> \ No newline at end of file diff --git a/src/index.php b/src/index.php index f9c80be..befa04c 100644 --- a/src/index.php +++ b/src/index.php @@ -53,7 +53,8 @@ InitFilterHelpers(); // Helpers for frontend filtering! // --- // --- Define Extra Stylesheet! -$content['EXTRA_STYLESHEET'] = ''; +$content['EXTRA_STYLESHEET'] = '' . "\r\n"; +$content['EXTRA_STYLESHEET'] .= ''; // --- // --- CONTENT Vars diff --git a/src/lang/en/main.php b/src/lang/en/main.php index e7f4005..2e7c580 100644 --- a/src/lang/en/main.php +++ b/src/lang/en/main.php @@ -40,6 +40,8 @@ $content['LN_GEN_PREVIOUSPAGE'] = "Previous Page"; $content['LN_GEN_RECORDCOUNT'] = "Total records found"; $content['LN_GEN_PAGERSIZE'] = "Records per page"; $content['LN_GEN_PAGE'] = "Page"; +$content['LN_GEN_PREDEFINEDSEARCHES'] = "Predefined Searches"; + // Main Index Site $content['LN_ERROR_INSTALLFILEREMINDER'] = "Warning! You still have NOT removed the 'install.php' from your phpLogCon main directory!"; diff --git a/src/templates/index.html b/src/templates/index.html index 92c349a..72e5a04 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -3,11 +3,26 @@ - + + + + - @@ -86,18 +104,18 @@ - + - + - + - + diff --git a/src/themes/default/main.css b/src/themes/default/main.css index a0b655c..9ce5f62 100644 --- a/src/themes/default/main.css +++ b/src/themes/default/main.css @@ -385,7 +385,7 @@ A.cellmenu1_link:hover } /* Form elements */ -select, input, button, textarea, .SelectSavedFilter +select, input, button, textarea { background-color: #E8E7E2; color:#000000;
 {LN_SEARCH_FILTER} - - + + +
@@ -17,40 +32,43 @@
+ {LN_SEARCH_ADVANCED}
(sample: faciliy:local0 severity:warning)
- - - - - - - - - - - - - -
- {LN_HIGHLIGHT_WORDS}
- - -
- - - - - - -
{highlight_raw}
-
-
+
+ + + + + + + + + + + + + + +
+ {LN_HIGHLIGHT_WORDS}
+ + +
+ + + + + + +
{highlight_raw}
+
+
+
{ViewEntriesPerPage} Pager:         {mypagenumber}