mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
Merge branch 'beta' into devel
This commit is contained in:
commit
f9ff5748a6
@ -1005,6 +1005,15 @@ abstract class LogStream {
|
||||
$myBits |= FILTER_MODE_SEARCHFULL;
|
||||
}
|
||||
|
||||
// If Filter is a REGEX match!
|
||||
$pos = strpos($szValue, "~");
|
||||
if ( $pos !== false && $pos == 0 )
|
||||
{
|
||||
//trunscate -
|
||||
$szValue = substr( $szValue, 1);
|
||||
$myBits |= FILTER_MODE_SEARCHREGEX;
|
||||
}
|
||||
|
||||
// return result
|
||||
return $myBits;
|
||||
}
|
||||
|
@ -801,6 +801,18 @@ class LogStreamDB extends LogStream {
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHREGEX )
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addnod = "";
|
||||
else
|
||||
$addnod = " NOT";
|
||||
// ---
|
||||
|
||||
$szSearchBegin = " REGEXP '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
|
@ -800,6 +800,48 @@ class LogStreamPDO extends LogStream {
|
||||
}
|
||||
// ---
|
||||
}
|
||||
else if ( $myfilter[FILTER_MODE] & FILTER_MODE_SEARCHREGEX )
|
||||
{
|
||||
//REGEXP Supported by MYSQL
|
||||
if ( $this->_logStreamConfigObj->DBType == DB_MYSQL )
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addnod = " ";
|
||||
else
|
||||
$addnod = " NOT";
|
||||
// ---
|
||||
|
||||
$szSearchBegin = "REGEXP '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
//REGEXP Supported by POSTGRESQL
|
||||
else if ( $this->_logStreamConfigObj->DBType == DB_PGSQL )
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addnod = " ";
|
||||
else
|
||||
$addnod = " !";
|
||||
// ---
|
||||
|
||||
$szSearchBegin = "~* '";
|
||||
$szSearchEnd = "' ";
|
||||
}
|
||||
else //Fallback use LIKE
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
if ( $myfilter[FILTER_MODE] & FILTER_MODE_INCLUDE)
|
||||
$addnod = " ";
|
||||
else
|
||||
$addnod = " NOT";
|
||||
// ---
|
||||
|
||||
// Database Layer does not support REGEXP
|
||||
$szSearchBegin = "LIKE '%";
|
||||
$szSearchEnd = "%' ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Check if user wants to include or exclude!
|
||||
|
@ -67,6 +67,7 @@ define('FILTER_MODE', 'filtermode');
|
||||
define('FILTER_MODE_INCLUDE', 1);
|
||||
define('FILTER_MODE_EXCLUDE', 2);
|
||||
define('FILTER_MODE_SEARCHFULL', 4);
|
||||
define('FILTER_MODE_SEARCHREGEX', 8);
|
||||
|
||||
// --- Init Facility LIST
|
||||
$content['filter_facility_list'][] = array( "ID" => SYSLOG_KERN, "DisplayName" => "KERN", "selected" => "" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user