pyloggr.main.filter_machine

The Filter Machine process can be used to apply series of filters to events

class FilterMachine(consumer_config, publisher_config, filters_filename)[source]

Bases: object

Implements an Event parser than retrieves events from RabbitMQ, apply filters, and pushes back events to RabbitMQ.

_apply_filters(message)[source]

Apply filters to the event inside the RabbitMQ message.

Note

This method is executed in a separated thread.

Parameters:message (pyloggr.consumer.RabbitMQMessage) – event to apply filters to, as a RabbitMQ message
Returns:tuple(message, parsed event). parsed event is None when event couldn’t be parsed.
Return type:tuple(pyloggr.consumer.RabbitMQMessage, pyloggr.event.Event)
launch(*args, **kwargs)[source]

Starts the parser

Note

Coroutine

shutdown(*args, **kwargs)[source]

Shutdowns (stops definitely) the parser

stop(*args, **kwargs)[source]

Stops the parser