sawmill.filterer.item¶
-
class
sawmill.filterer.item.Item(key, value, mode='include')[source]¶ Bases:
sawmill.filterer.base.FiltererFilter logs based on key, value item matching.
-
__init__(key, value, mode='include')[source]¶ Initialise filterer with key and value to test against.
mode can be either
EXCLUDEorINCLUDE. If set toEXCLUDEthen any log that has the specific key, value pair will be filtered. Conversely, if set toINCLUDEthen any log not matching the key, value pair exactly will be filtered.
-
filter(logs)[source]¶ Filter logs based on key, value item matching.
If a log does not have the key to test against and mode is set to
INCLUDEit will be filtered. Conversely, if mode is set toEXCLUDEit will not be filtered.
-
EXCLUDE= 'exclude'¶
-
INCLUDE= 'include'¶
-