#include <log_builtins_filter.h>
◆ filter_rule_init
Initialize a new rule.
This clears the first unused rule. It does not update the rules count; this is for the caller to do if it succeeds in setting up the rule to its satisfaction. If the caller fails, it should log_builtins_filter_rule_free() the incomplete rule.
- Parameters
-
ruleset | a ruleset (usually allocated with filter_ruleset_new()) |
- Returns
- nullptr: could not initialize rule. Do not call rule_free. !nullptr: the address of the rule. fill in. on success, caller must increase rule count. on failure, it must call rule_free.
◆ filter_ruleset_drop
Drop an entire filter rule-set.
Must hold lock.
- Parameters
-
ruleset | a ruleset * (usually allocated with filter_ruleset_new()) |
◆ filter_ruleset_free
Free an entire filter rule-set.
Must hold lock. Lock will be destroyed.
- Parameters
-
ruleset | a ruleset * (usually allocated with filter_ruleset_new()) the pointer pointed to will be a nullptr on return. |
◆ filter_ruleset_lock
Lock and get the filter rules.
- Parameters
-
ruleset | a ruleset (usually allocated with filter_ruleset_new()) |
locktype | LOG_BUILTINS_LOCK_SHARED lock for reading LOG_BUILTINS_LOCK_EXCLUSIVE lock for writing |
- Return values
-
0 | lock acquired |
!0 | failed to acquire lock |
◆ filter_ruleset_move
Move rules from one ruleset to another.
Origin will be empty afterwards.
- Parameters
-
from | source ruleset |
to | destination ruleset |
◆ filter_ruleset_new
Create a new set of filter rules.
- Parameters
-
tag | tag for this ruleset |
count | number of rules to allocate |
- Return values
-
a | pointer to a ruleset structure, or nullptr on failure |
◆ filter_ruleset_unlock
Release lock on filter rules.
- Parameters
-
ruleset | a ruleset (usually allocated with filter_ruleset_new()) |
◆ filter_run
Apply all matching rules from a filter rule set to a given log line.
- Parameters
-
- Return values
-
int | number of matched rules |
The documentation for this struct was generated from the following file: