MySQL 8.3.0
Source Code Documentation
log_filter_dragnet.cc File Reference

Classes

struct  log_filter_xlate_key
 Element in an array of known tokens in the filter configuration language. More...
 

Macros

#define LOG_FILTER_DUMP_BUFF_SIZE   8192
 There is a new filter engine in the server proper (components/mysql_server/log_builtins_filter.cc). More...
 
#define LOG_FILTER_LANGUAGE_NAME   "dragnet"
 
#define LOG_FILTER_SYSVAR_NAME   "log_error_filter_rules"
 
#define LOG_FILTER_STATUS_NAME   "Status"
 
#define LOG_FILTER_DEFAULT_RULES
 

Typedefs

typedef enum enum_log_filter_xlate_flags log_filter_xlate_flags
 Flags to use in log_filter_xlate_by_name() / log_filter_xlate_by_opcode() when looking up a token by its opcode, or vice versa. More...
 
typedef enum enum_log_filter_token_flags log_filter_token_flags
 What kind of token should log_filter_get_token() look for? More...
 
typedef enum enum_log_filter_syntax log_filter_syntax
 A few keywords that we look for while parsing, but that do not necessarily generate an opcode in the rule-set. More...
 
typedef enum enum_log_filter_result log_filter_result
 result codes used in dumping/decompiling rules More...
 
typedef enum enum_set_arg_result set_arg_result
 result codes of log_filter_set_arg() More...
 

Enumerations

enum  enum_log_filter_xlate_flags {
  LOG_FILTER_XLATE_NONE = 0 , LOG_FILTER_XLATE_COND = 1 , LOG_FILTER_XLATE_REF = 2 , LOG_FILTER_XLATE_PREFIX = 4 ,
  LOG_FILTER_XLATE_LITERAL = 8 , LOG_FILTER_XLATE_VERB = 32 , LOG_FILTER_XLATE_AUXNAME = 64 , LOG_FILTER_XLATE_AUXVAL = 128 ,
  LOG_FILTER_XLATE_FLOW = 1024 , LOG_FILTER_XLATE_CHAIN = 2048
}
 Flags to use in log_filter_xlate_by_name() / log_filter_xlate_by_opcode() when looking up a token by its opcode, or vice versa. More...
 
enum  enum_log_filter_token_flags {
  LOG_FILTER_TOKEN_NONE = 0 , LOG_FILTER_TOKEN_NAME = 1 , LOG_FILTER_TOKEN_NUMERIC = 2 , LOG_FILTER_TOKEN_COMP = 4 ,
  LOG_FILTER_TOKEN_ARG = 32 , LOG_FILTER_TOKEN_ACTION = 64 , LOG_FILTER_TOKEN_KEYWORD = 128
}
 What kind of token should log_filter_get_token() look for? More...
 
enum  enum_log_filter_syntax {
  LOG_FILTER_WORD_NONE = 0 , LOG_FILTER_WORD_IF = 1 , LOG_FILTER_WORD_THEN = 2 , LOG_FILTER_WORD_ELSEIF = 3 ,
  LOG_FILTER_WORD_ELSE = 4
}
 A few keywords that we look for while parsing, but that do not necessarily generate an opcode in the rule-set. More...
 
enum  enum_log_filter_result {
  LOG_FILTER_LANGUAGE_OK = 0 , LOG_FILTER_LANGUAGE_DK_COND = 1 , LOG_FILTER_LANGUAGE_DK_VERB = 2 , LOG_FILTER_LANGUAGE_DK_CLASS = 3 ,
  LOG_FILTER_LANGUAGE_OOM = 4 , LOG_FILTER_LANGUAGE_GET_FAILED = 5 , LOG_FILTER_LANGUAGE_CHAIN = 6
}
 result codes used in dumping/decompiling rules More...
 
enum  enum_set_arg_result {
  SET_ARG_SUCCESS = 0 , SET_ARG_OOM = -1 , SET_ARG_MALFORMED_FLOAT = -2 , SET_ARG_DK_CLASS = -3 ,
  SET_ARG_UNWANTED_NUMERIC = -4 , SET_ARG_UNWANTED_STRING = -5 , SET_ARG_MALFORMED_VALUE = -6 , SET_ARG_UNWANTED_FLOAT = -7 ,
  SET_ARG_FRACTION_FOUND = -8
}
 result codes of log_filter_set_arg() More...
 

Functions

 REQUIRES_SERVICE_PLACEHOLDER (component_sys_variable_register)
 
 REQUIRES_SERVICE_PLACEHOLDER (component_sys_variable_unregister)
 
 REQUIRES_SERVICE_PLACEHOLDER (status_variable_registration)
 
 STR_CHECK_ARG (rules) values_filter_rules
 limits and default for sysvar More...
 
 REQUIRES_SERVICE_PLACEHOLDER (log_builtins)
 
 REQUIRES_SERVICE_PLACEHOLDER (log_builtins_string)
 
 REQUIRES_SERVICE_PLACEHOLDER (log_builtins_filter)
 
 REQUIRES_SERVICE_PLACEHOLDER (log_builtins_tmp)
 
static int log_filter_xlate_by_name (const char *token, size_t len, uint flags)
 Find a given token in log_filter_xlate_keys[], the table of known tokens. More...
 
static int log_filter_xlate_by_opcode (uint opcode, uint flags)
 Find a given opcode in log_filter_xlate_keys[], the table of known tokens. More...
 
static void log_filter_append (char *out_buf, size_t out_siz, const char *str)
 Helper for dumping filter rules. More...
 
static void log_filter_append_item_value (char *out_buf, size_t out_siz, log_item *li)
 Helper for dumping filter rules. More...
 
static log_filter_result log_filter_rule_dump (log_filter_rule *rule, log_filter_result state, char *out_buf, size_t out_size)
 Decompile an individual rule. More...
 
log_filter_result log_filter_ruleset_dump (log_filter_ruleset *ruleset, char *ruleset_buf, size_t siz)
 Dump an entire filter rule-set. More...
 
static void log_filter_skip_white (const char **inp_readpos)
 Skip whitespace. More...
 
static int log_filter_get_token (const char **inp_readpos, const char **token, size_t *len, uint types)
 Gets a token from a filter configuration. More...
 
static int log_filter_make_field (const char **name, const size_t *len, log_item *li)
 Set up a log-item from filtering rules. More...
 
static bool log_filter_generic_type (log_item_type type)
 Helper: Does a field require a certain data class, or can it morph into whatever value we wish to assign to it? The former is the case if the field either has a generic (rather than well-known) type, or if it has no type at all (this is the case if a rule has an unnamed aux item). More...
 
static set_arg_result log_filter_set_arg (const char **token, const size_t *len, log_item *li, const char **state)
 Set argument (i.e., the value) on a list-item. More...
 
static int log_filter_dragnet_set (log_filter_ruleset *ruleset, const char *rules, const char **state)
 Set filtering rules from human-readable configuration string. More...
 
static int check_var_filter_rules (MYSQL_THD thd, SYS_VAR *self, void *save, struct st_mysql_value *value)
 Check the proposed value for the component variable which contains the filter rules in human-readable format. More...
 
static void update_var_filter_rules (MYSQL_THD thd, SYS_VAR *self, void *var_ptr, const void *save)
 Update value of component variable. More...
 
mysql_service_status_t log_filter_exit ()
 De-initialization method for Component used when unloading the Component. More...
 
mysql_service_status_t log_filter_init ()
 Initialization entry method for Component used when loading the Component. More...
 
 PROVIDES_SERVICE (log_filter_dragnet, log_service)
 
 END_COMPONENT_PROVIDES ()
 
 REQUIRES_SERVICE (component_sys_variable_register)
 
 REQUIRES_SERVICE (component_sys_variable_unregister)
 
 REQUIRES_SERVICE (status_variable_registration)
 
 REQUIRES_SERVICE (log_builtins)
 
 REQUIRES_SERVICE (log_builtins_string)
 
 REQUIRES_SERVICE (log_builtins_filter)
 
 REQUIRES_SERVICE (log_builtins_tmp)
 
 END_COMPONENT_REQUIRES ()
 
 METADATA ("mysql.author", "Oracle Corporation")
 
 METADATA ("mysql.license", "GPL")
 
 METADATA ("log_service_type", "filter")
 
 END_COMPONENT_METADATA ()
 

Variables

static char * log_error_filter_rules = nullptr
 sysvar containing rules More...
 
static char log_error_filter_decompile [LOG_FILTER_DUMP_BUFF_SIZE] = ""
 
static SHOW_VAR show_var_filter_rules_decompile []
 
static bool inited = false
 
static int opened = 0
 
const mysql_service_log_builtins_tlog_bi = nullptr
 accessor built-ins More...
 
const mysql_service_log_builtins_string_tlog_bs = nullptr
 string built-ins More...
 
const mysql_service_log_builtins_filter_tlog_bf = nullptr
 filter built-ins More...
 
const mysql_service_log_builtins_tmp_tlog_bt = nullptr
 notify built-in More...
 
log_filter_tag rule_tag_dragnet
 
log_filter_rulesetlog_filter_dragnet_rules = nullptr
 
static const log_filter_xlate_key log_filter_xlate_keys []
 Array of known tokens in the filter configuration language. More...
 
const mysql_service_log_service_t imp_log_filter_dragnet_log_service
 
mysql_component_t mysql_component_log_filter_dragnet
 

Macro Definition Documentation

◆ LOG_FILTER_DEFAULT_RULES

#define LOG_FILTER_DEFAULT_RULES
Value:
"IF prio>=INFORMATION THEN drop. IF " \
"EXISTS source_line THEN unset source_line."

◆ LOG_FILTER_DUMP_BUFF_SIZE

#define LOG_FILTER_DUMP_BUFF_SIZE   8192

There is a new filter engine in the server proper (components/mysql_server/log_builtins_filter.cc).

It can apply highly versatile filtering rules to log events. By default however, it loads a rule-set that emulates mysqld 5.7 behavior, so as far as the users are concerned, the configuration variables (–log_error_verbosity ...) and the behavior haven't changed (much).

The loadable service implemented in this file is noteworthy in that it does not implement a complete filtering service; instead, it implements a configuration language for the internal filter that gives users access to all its features (rather than just to the small 5.7 compatibility subset).

Therefore, this file contains the parsing of the new configuration language (the "configuration engine"), whereas log_builtins_filter.cc contains the filtering engine.

CONFIGURATION PARSING STAGE

As a courtesy, during parsing (e.g. "IF prio>=3 THEN drop."), the filter configuration engine checks whether it knows the field ("prio"), and if so, whether the storage class it expects for the field (integer) matches that of the argument (3). In our example, it does; if it didn't, the configuration engine would throw an error.

The same applies if a well-known field appears in the action (e.g. the action 'set log_label:="HELO".' in the rule 'IF err_code==1408 THEN set label:="HELO".') label is a well-known field here, its well-known storage class is string, and since "HELO" is a string, all's well. (Otherwise, again, we'd throw an error.)

◆ LOG_FILTER_LANGUAGE_NAME

#define LOG_FILTER_LANGUAGE_NAME   "dragnet"

◆ LOG_FILTER_STATUS_NAME

#define LOG_FILTER_STATUS_NAME   "Status"

◆ LOG_FILTER_SYSVAR_NAME

#define LOG_FILTER_SYSVAR_NAME   "log_error_filter_rules"

Typedef Documentation

◆ log_filter_result

result codes used in dumping/decompiling rules

◆ log_filter_syntax

A few keywords that we look for while parsing, but that do not necessarily generate an opcode in the rule-set.

◆ log_filter_token_flags

What kind of token should log_filter_get_token() look for?

◆ log_filter_xlate_flags

Flags to use in log_filter_xlate_by_name() / log_filter_xlate_by_opcode() when looking up a token by its opcode, or vice versa.

◆ set_arg_result

result codes of log_filter_set_arg()

Enumeration Type Documentation

◆ enum_log_filter_result

result codes used in dumping/decompiling rules

Enumerator
LOG_FILTER_LANGUAGE_OK 

processed without error

LOG_FILTER_LANGUAGE_DK_COND 

don't know condition

LOG_FILTER_LANGUAGE_DK_VERB 

don't know verb

LOG_FILTER_LANGUAGE_DK_CLASS 

don't know class

LOG_FILTER_LANGUAGE_OOM 

out of memory

LOG_FILTER_LANGUAGE_GET_FAILED 

filter_ruleset_get() failed

LOG_FILTER_LANGUAGE_CHAIN 

chain conditions (AND/OR)

◆ enum_log_filter_syntax

A few keywords that we look for while parsing, but that do not necessarily generate an opcode in the rule-set.

Enumerator
LOG_FILTER_WORD_NONE 

no previous statement, or stmt complete

LOG_FILTER_WORD_IF 

"if"

LOG_FILTER_WORD_THEN 

"then"

LOG_FILTER_WORD_ELSEIF 

"elseif"

LOG_FILTER_WORD_ELSE 

"else"

◆ enum_log_filter_token_flags

What kind of token should log_filter_get_token() look for?

Enumerator
LOG_FILTER_TOKEN_NONE 

undef

LOG_FILTER_TOKEN_NAME 

grab a field name

LOG_FILTER_TOKEN_NUMERIC 

grab a number

LOG_FILTER_TOKEN_COMP 

grab a known comparator

LOG_FILTER_TOKEN_ARG 

grab an argument, possibly quoted

LOG_FILTER_TOKEN_ACTION 

part of action, ultimately ends in .

LOG_FILTER_TOKEN_KEYWORD 

if/else/etc.

◆ enum_log_filter_xlate_flags

Flags to use in log_filter_xlate_by_name() / log_filter_xlate_by_opcode() when looking up a token by its opcode, or vice versa.

Enumerator
LOG_FILTER_XLATE_NONE 

we don't know what it is

LOG_FILTER_XLATE_COND 

it's a condition

LOG_FILTER_XLATE_REF 

needs reference item to compare with

LOG_FILTER_XLATE_PREFIX 

prefix rather than infix, no ref item

LOG_FILTER_XLATE_LITERAL 

operator only (no field-name)

LOG_FILTER_XLATE_VERB 

it's an action

LOG_FILTER_XLATE_AUXNAME 

aux item name required

LOG_FILTER_XLATE_AUXVAL 

aux item value required

LOG_FILTER_XLATE_FLOW 

if/then/else/...

LOG_FILTER_XLATE_CHAIN 

or/and

◆ enum_set_arg_result

result codes of log_filter_set_arg()

Enumerator
SET_ARG_SUCCESS 

argument was assigned

SET_ARG_OOM 

out of memory while assigning argument

SET_ARG_MALFORMED_FLOAT 

too many decimal points

SET_ARG_DK_CLASS 

unhandled class

SET_ARG_UNWANTED_NUMERIC 

numeric value found for non-numeric item

SET_ARG_UNWANTED_STRING 

string value found for non-string item

SET_ARG_MALFORMED_VALUE 

malformed value

SET_ARG_UNWANTED_FLOAT 

float value found for non-float item

SET_ARG_FRACTION_FOUND 

fraction found. may or may not be legal

Function Documentation

◆ check_var_filter_rules()

static int check_var_filter_rules ( MYSQL_THD  thd,
SYS_VAR self,
void *  save,
struct st_mysql_value value 
)
static

Check the proposed value for the component variable which contains the filter rules in human-readable format.

Parameters
thdsession
selfthe system variable we're checking
savewhere to save the resulting intermediate (char *) value
valuethe value we're validating
Return values
falsevalue OK, go ahead and update system variable (from "save")
truevalue rejected, do not update variable

< result code from dump

◆ END_COMPONENT_METADATA()

END_COMPONENT_METADATA ( )

◆ END_COMPONENT_PROVIDES()

END_COMPONENT_PROVIDES ( )

◆ END_COMPONENT_REQUIRES()

END_COMPONENT_REQUIRES ( )

◆ log_filter_append()

static void log_filter_append ( char *  out_buf,
size_t  out_siz,
const char *  str 
)
static

Helper for dumping filter rules.

Append a string literal to a buffer. Used by log_filter_rule_dump().

Parameters
out_bufNTBS buffer to append to. must contain at least '\0'
out_sizsize of that buffer
strNTBS to append to that buffer

◆ log_filter_append_item_value()

static void log_filter_append_item_value ( char *  out_buf,
size_t  out_siz,
log_item li 
)
static

Helper for dumping filter rules.

Append an item's data/value to a buffer. Used by log_filter_rule_dump().

Parameters
out_bufNTBS buffer to append to. must contain at least '\0'
out_sizsize of that buffer
lilog-item whose value to append to that buffer

◆ log_filter_dragnet_set()

static int log_filter_dragnet_set ( log_filter_ruleset ruleset,
const char *  rules,
const char **  state 
)
static

Set filtering rules from human-readable configuration string.

Parameters
rulesetruleset to update
rulesa NTBS containing zero, one, or many rules
[out]statea pointer to additional info about the state. (this is free-text intended for error messages.)
Return values
0no problems
-1could not acquire ruleset
-2out of memory
-3invalid arguments
>0parse problem at this index in rule string

< current rule

< previous rule, if any

< read position in submitted rules

< retry from here on misparse

< current token in input

< token's length

< counter

< return code for caller

< previous flow control command

< current flow control command

< rule that had the opening IF

< number of conditions in branch

< the rule-set we're creating

< implicit item for "unset"

< have half-finished rule?

◆ log_filter_exit()

mysql_service_status_t log_filter_exit ( )

De-initialization method for Component used when unloading the Component.

Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ log_filter_generic_type()

static bool log_filter_generic_type ( log_item_type  type)
inlinestatic

Helper: Does a field require a certain data class, or can it morph into whatever value we wish to assign to it? The former is the case if the field either has a generic (rather than well-known) type, or if it has no type at all (this is the case if a rule has an unnamed aux item).

Parameters
typethe type to examine
Return values
trueif field is of generic type or no type
falseotherwise

◆ log_filter_get_token()

static int log_filter_get_token ( const char **  inp_readpos,
const char **  token,
size_t *  len,
uint  types 
)
static

Gets a token from a filter configuration.

Parameters
[in,out]inp_readposparse position pointer, in: current token, out: next token (on success), current token (on failure)
[out]tokenpointer to start of (if arg-type, possible quoted) token
[out]lenlength of (if arg-type, possibly quoted) token (0 on fail)
typeswhat kind of token (and in what context) do we want?
Return values
0OK
-1incorrect quotation
-2unknown values for 'types'

◆ log_filter_init()

mysql_service_status_t log_filter_init ( )

Initialization entry method for Component used when loading the Component.

Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ log_filter_make_field()

static int log_filter_make_field ( const char **  name,
const size_t *  len,
log_item li 
)
static

Set up a log-item from filtering rules.

Parameters
namepointer to field name (ad hoc or well-known)
lenlength of field name
lilog item to set up
Return values
0OK
-1invalid log-item type (reserved name)
-2copy failed (out of memory?)

◆ log_filter_rule_dump()

static log_filter_result log_filter_rule_dump ( log_filter_rule rule,
log_filter_result  state,
char *  out_buf,
size_t  out_size 
)
static

Decompile an individual rule.

At this point, we only ever decompile rules we've previously compiled ourselves, so short of memory corruption or running out of space, this should not fail. We check for failure all the same so all this will remain safe if we ever allow decompiles of other components' rule-sets.

Parameters
rulerule to decompile
stateresulting state of previous rule's decompile, if any (so we can identify chained rules etc.)
out_bufbuffer to hold the decompiled rule
out_sizesize of that buffer
Return values
LOG_FILTER_LANGUAGE_OKdecompile succeeded
LOG_FILTER_LANGUAGE_DK_CONDrule corrupted; condition unknown
LOG_FILTER_LANGUAGE_DK_VERBrule corrupted; action-verb unknown
LOG_FILTER_LANGUAGE_CHAINchain rules (AND/OR)

◆ log_filter_ruleset_dump()

log_filter_result log_filter_ruleset_dump ( log_filter_ruleset ruleset,
char *  ruleset_buf,
size_t  siz 
)

Dump an entire filter rule-set.

Parameters
rulesetrule-set to decompile
ruleset_bufbuffer to write the decompiled ruleset to
sizsize of that buffer in bytes
Return values
LOG_FILTER_LANGUAGE_OKdecompiling succeeded
LOG_FILTER_LANGUAGE_GET_FAILEDcouldn't get rules
LOG_FILTER_LANGUAGE_OOMsupplied buffer too small

< return this result

< index of current rule

< rule to decompile

< current decompiled rule

< write pointer

< bytes left (out buffer)

< bytes used in a buffer

◆ log_filter_set_arg()

static set_arg_result log_filter_set_arg ( const char **  token,
const size_t *  len,
log_item li,
const char **  state 
)
static

Set argument (i.e., the value) on a list-item.

If the item is of any generic type, we'll set the value, and adjust the type to be of an appropriate ad hoc type. If the item is of a well-known type, we'll set the value on it if it's of an appropriate type, but will fail otherwise. For this, an integer constitutes a valid float, but not vice versa. (A string containing nothing but a number is still not a number.)

Parameters
tokenpointer to the beginning of the value-token
lenlength of the argument/token
lilog-item to set the value on
[out]statea pointer to additional info about the state. (this is free-text intended for error messages.)
Returns
set_arg_result; 0 for success, !0 for failure

◆ log_filter_skip_white()

static void log_filter_skip_white ( const char **  inp_readpos)
inlinestatic

Skip whitespace.

Helper for parsing. Advances a read-pointer to the next non-space character.

Parameters
[in,out]inp_readposPointer to a NTBS.

◆ log_filter_xlate_by_name()

static int log_filter_xlate_by_name ( const char *  token,
size_t  len,
uint  flags 
)
static

Find a given token in log_filter_xlate_keys[], the table of known tokens.

A token in the array will only be considered a valid match if it features at least one flag requested by the caller (i.e. if it is of the requested class – comparator, action-verb, etc.). Used by log_filter_dragnet_set() to convert tokens into opcodes.

Parameters
tokentoken to look up
lenlength of token in bytes
flagscombination of log_filter_xlate_flags
Returns
<0 token not found
>=0 index into log_filter_xlate_keys[]

◆ log_filter_xlate_by_opcode()

static int log_filter_xlate_by_opcode ( uint  opcode,
uint  flags 
)
static

Find a given opcode in log_filter_xlate_keys[], the table of known tokens.

An opcode in the array will only be considered a valid match if it features at least one flag requested by the caller (i.e. if it is of the requested class – comparator, action-verb, etc.). Used by log_filter_rule_dump() to convert opcodes into printable tokens.

Parameters
opcodeopcode to look up
flagscombination of log_filter_xlate_flags
Returns
-1 opcode not found
>=0 index into log_filter_xlate_keys[]

◆ METADATA() [1/3]

METADATA ( "log_service_type"  ,
"filter"   
)

◆ METADATA() [2/3]

METADATA ( "mysql.author"  ,
"Oracle Corporation"   
)

◆ METADATA() [3/3]

METADATA ( "mysql.license"  ,
"GPL"   
)

◆ PROVIDES_SERVICE()

PROVIDES_SERVICE ( log_filter_dragnet  ,
log_service   
)

◆ REQUIRES_SERVICE() [1/7]

REQUIRES_SERVICE ( component_sys_variable_register  )

◆ REQUIRES_SERVICE() [2/7]

REQUIRES_SERVICE ( component_sys_variable_unregister  )

◆ REQUIRES_SERVICE() [3/7]

REQUIRES_SERVICE ( log_builtins  )

◆ REQUIRES_SERVICE() [4/7]

REQUIRES_SERVICE ( log_builtins_filter  )

◆ REQUIRES_SERVICE() [5/7]

REQUIRES_SERVICE ( log_builtins_string  )

◆ REQUIRES_SERVICE() [6/7]

REQUIRES_SERVICE ( log_builtins_tmp  )

◆ REQUIRES_SERVICE() [7/7]

REQUIRES_SERVICE ( status_variable_registration  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [1/7]

REQUIRES_SERVICE_PLACEHOLDER ( component_sys_variable_register  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [2/7]

REQUIRES_SERVICE_PLACEHOLDER ( component_sys_variable_unregister  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [3/7]

REQUIRES_SERVICE_PLACEHOLDER ( log_builtins  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [4/7]

REQUIRES_SERVICE_PLACEHOLDER ( log_builtins_filter  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [5/7]

REQUIRES_SERVICE_PLACEHOLDER ( log_builtins_string  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [6/7]

REQUIRES_SERVICE_PLACEHOLDER ( log_builtins_tmp  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [7/7]

REQUIRES_SERVICE_PLACEHOLDER ( status_variable_registration  )

◆ STR_CHECK_ARG()

STR_CHECK_ARG ( rules  )

limits and default for sysvar

◆ update_var_filter_rules()

static void update_var_filter_rules ( MYSQL_THD  thd,
SYS_VAR self,
void *  var_ptr,
const void *  save 
)
static

Update value of component variable.

Parameters
thdsession
selfthe system variable we're changing
var_ptrwhere to save the resulting (char *) value
savepointer to the new value (from check function)

Variable Documentation

◆ imp_log_filter_dragnet_log_service

const mysql_service_log_service_t imp_log_filter_dragnet_log_service
Initial value:
= {
nullptr }
static int characteristics(void) noexcept
Get characteristics of a log-service.
Definition: log_filter_dragnet.cc:1623
static int run(void *instance, log_line *ll) noexcept
Have the service process one log line.
Definition: log_filter_dragnet.cc:1545
static log_service_error flush(void **instance) noexcept
Flush any buffers.
Definition: log_filter_dragnet.cc:1613

◆ inited

bool inited = false
static

◆ log_bf

filter built-ins

◆ log_bi

accessor built-ins

◆ log_bs

string built-ins

◆ log_bt

notify built-in

◆ log_error_filter_decompile

char log_error_filter_decompile[LOG_FILTER_DUMP_BUFF_SIZE] = ""
static

◆ log_error_filter_rules

char* log_error_filter_rules = nullptr
static

sysvar containing rules

◆ log_filter_dragnet_rules

log_filter_ruleset* log_filter_dragnet_rules = nullptr

◆ log_filter_xlate_keys

const log_filter_xlate_key log_filter_xlate_keys[]
static

Array of known tokens in the filter configuration language.

◆ mysql_component_log_filter_dragnet

mysql_component_t mysql_component_log_filter_dragnet
Initial value:
= { "mysql:log_filter_dragnet" , __log_filter_dragnet_provides, __log_filter_dragnet_requires, __log_filter_dragnet_metadata,
mysql_service_status_t log_filter_init()
Initialization entry method for Component used when loading the Component.
Definition: log_filter_dragnet.cc:1662
mysql_service_status_t log_filter_exit()
De-initialization method for Component used when unloading the Component.
Definition: log_filter_dragnet.cc:1634

◆ opened

int opened = 0
static

◆ rule_tag_dragnet

log_filter_tag rule_tag_dragnet
Initial value:
= {"log_filter_" LOG_FILTER_LANGUAGE_NAME,
nullptr}
#define LOG_FILTER_LANGUAGE_NAME
Definition: log_filter_dragnet.cc:67

◆ show_var_filter_rules_decompile

SHOW_VAR show_var_filter_rules_decompile[]
static
Initial value:
= {
{nullptr, nullptr, SHOW_UNDEF,
}
#define LOG_FILTER_STATUS_NAME
Definition: log_filter_dragnet.cc:69
static char log_error_filter_decompile[LOG_FILTER_DUMP_BUFF_SIZE]
Definition: log_filter_dragnet.cc:94
@ SHOW_CHAR
Definition: status_var.h:35
@ SHOW_UNDEF
Definition: status_var.h:30
@ SHOW_SCOPE_GLOBAL
Definition: status_var.h:69
@ SHOW_SCOPE_UNDEF
Definition: status_var.h:68