[Multiple] Push multiple logs to Redis channel for fail2ban-mailcow to read. Enables Fail2ban independently of used Docker logging driver.
This commit is contained in:
@@ -15,17 +15,27 @@ source s_src {
|
||||
};
|
||||
|
||||
destination d_combined { file("/var/log/combined.log"); };
|
||||
destination d_redis {
|
||||
destination d_redis_persistent_log {
|
||||
redis(
|
||||
host("redis-mailcow")
|
||||
persist-name("redis1")
|
||||
port(6379)
|
||||
command("LPUSH" "DOVECOT_MAILLOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
|
||||
);
|
||||
};
|
||||
filter f_mail { facility(mail) and not filter(f_debug); };
|
||||
destination d_redis_f2b_channel {
|
||||
redis(
|
||||
host("redis-mailcow")
|
||||
persist-name("redis2")
|
||||
port(6379)
|
||||
command("PUBLISH" "F2B_CHANNEL" "$MESSAGE")
|
||||
);
|
||||
};
|
||||
filter f_mail { facility(mail); };
|
||||
log {
|
||||
source(s_src);
|
||||
destination(d_combined);
|
||||
filter(f_mail);
|
||||
destination(d_redis);
|
||||
destination(d_redis_persistent_log);
|
||||
destination(d_redis_f2b_channel);
|
||||
};
|
||||
|
Reference in New Issue
Block a user