Lightweight replacement to both epylog and fail2ban.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
478 B

# pyruse is intended as a replacement to both fail2ban and epylog
# Copyright © 2017–2018 Y. Gablin
# Full licensing information in the LICENSE file, or if the file is missing.
from pyruse import base
class Filter(base.Filter):
def __init__(self, args):
self.field = args["field"]
self.values = args["values"]
def filter(self, entry):
return entry.get(self.field, None) in self.values