intelmq.bots.experts.sieve package

Submodules module

SieveExpertBot filters and modifies events based on a specification language similar to mail sieve.

param file


alias of


Bases: enum.Enum

An enumeration.

DROP = 3
KEEP = 2
class str, start: bool = False, sighup_event=None, disable_multithreading: Optional[bool] = None)


Filter and modify events based on a sieve-based language

static check(parameters)

The bot’s own check function can perform individual checks on it’s parameters. init() is not called before, this is a staticmethod which does not require class initialization.


parameters – Bot’s parameters, defaults and runtime merged together


None or a list of [log_level, log_message] pairs, both

strings. log_level must be a valid log level.

Return type


compute_basic_math(action, event) str
file: str = '/opt/intelmq/var/lib/bots/sieve/filter.sieve'
static get_linecol(model_obj, as_dict=False)

Gets the position of a model object in the sieve file.

  • model_obj – the model object

  • as_dict – return the position as a dict instead of a tuple.


Returns the line and column number for the model object’s position in the sieve file. Default return type is a tuple of (line,col). Optionally, returns a dict when as_dict == True.

init() None
static init_metamodel()
match_expression(expr, event) bool
process() None
process_action(action, event)
process_bool_match(key, op, value, event)
process_branching(rule, event)
process_clause(clause, event, else_clause=False) Optional[]
process_condition(cond, event) bool
process_conjunction(conj, event) bool
static process_exist_match(key, op, event) bool
process_ip_range_match(key, ip_range, event) bool
process_list_match(key, op, value, event) bool
process_multi_numeric_match(key, op, value, event) bool
process_multi_string_match(key, op, value, event) bool
process_single_numeric_match(key, op, value, event) bool
process_single_string_match(key, op, value, event) bool
process_statement(statement, event)
static read_sieve_file(filename, metamodel)
static validate_ip_address(ipaddr) None
static validate_ip_range(ip_range) None
static validate_numeric_match(num_match) None

Validates a numeric match expression.

Checks if the event key (given on the left hand side of the expression) is of a valid type for a numeric match, according the the IntelMQ harmonization.


TextXSemanticError – when the key is of an incompatible type for numeric match expressions.

static validate_string_match(str_match) None

Validates a string match expression.

Checks if the type of the value given on the right hand side of the expression matches the event key in the left hand side, according to the IntelMQ harmonization.


TextXSemanticError – when the value is of incompatible type with the event key.

Module contents