diff --git a/CHANGELOG b/CHANGELOG index 8d2ce430f5..ece13b3603 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -42,6 +42,7 @@ Cacti CHANGELOG -feature: Allow the get_template_account() function to be hookable by third party plugin -feature: Allow The User Management interface to be filterable by Realm -feature: Prevent Template User Accounts from being Removed +-feature: Create more Filters for CLog Types 1.2.19 -security#4356: Further fixes for grave character security protection diff --git a/lib/clog_webapi.php b/lib/clog_webapi.php index a3fb114d93..98276a3352 100644 --- a/lib/clog_webapi.php +++ b/lib/clog_webapi.php @@ -533,12 +533,28 @@ function filter($clogAdmin, $selectedFile) { diff --git a/lib/functions.php b/lib/functions.php index cc39a2b2a2..bd29cffdc5 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1212,20 +1212,61 @@ function tail_file($file_name, $number_of_lines, $message_type = -1, $filter = ' function determine_display_log_entry($message_type, $line, $filter) { /* determine if we are to display the line */ switch ($message_type) { - case 1: /* stats */ + case 1: /* stats only */ $display = (strpos($line, 'STATS') !== false); + break; - case 2: /* warnings */ + case 2: /* warnings only */ $display = (strpos($line, 'WARN') !== false); + break; - case 3: /* errors */ + case 3: /* warnings + */ + $display = (strpos($line, 'WARN') !== false); + + if (!$display) { + $display = (strpos($line, 'ERROR') !== false); + } + + if (!$display) { + $display = (strpos($line, 'DEBUG') !== false); + } + + if (!$display) { + $display = (strpos($line, ' SQL') !== false); + } + + break; + case 4: /* errors only */ $display = (strpos($line, 'ERROR') !== false); + break; - case 4: /* debug */ + case 5: /* errors + */ + $display = (strpos($line, 'ERROR') !== false); + + if (!$display) { + $display = (strpos($line, 'DEBUG') !== false); + } + + if (!$display) { + $display = (strpos($line, ' SQL') !== false); + } + + break; + case 6: /* debug only */ $display = (strpos($line, 'DEBUG') !== false && strpos($line, ' SQL ') === false); + break; - case 5: /* sql calls */ + case 7: /* sql calls only */ $display = (strpos($line, ' SQL ') !== false); + + break; + case 8: /* AutoM8 Only */ + $display = (strpos($line, 'AUTOM8') !== false); + + break; + case 9: /* Non Stats */ + $display = (strpos($line, 'STATS') === false); + break; default: /* all other lines */ case -1: /* all */