syslog-ng-redis_slave.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. @version: 4.5
  2. @include "scl.conf"
  3. options {
  4. chain_hostnames(off);
  5. flush_lines(0);
  6. use_dns(no);
  7. use_fqdn(no);
  8. owner("root"); group("adm"); perm(0640);
  9. stats(freq(0));
  10. keep_timestamp(no);
  11. bad_hostname("^gconfd$");
  12. };
  13. source s_dgram {
  14. unix-dgram("/dev/log");
  15. internal();
  16. };
  17. destination d_stdout { pipe("/dev/stdout"); };
  18. destination d_redis_ui_log {
  19. redis(
  20. host("`REDIS_SLAVEOF_IP`")
  21. persist-name("redis1")
  22. port(`REDIS_SLAVEOF_PORT`)
  23. auth("`REDISPASS`")
  24. command("LPUSH" "DOVECOT_MAILLOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
  25. );
  26. };
  27. destination d_redis_f2b_channel {
  28. redis(
  29. host("`REDIS_SLAVEOF_IP`")
  30. persist-name("redis2")
  31. port(`REDIS_SLAVEOF_PORT`)
  32. auth("`REDISPASS`")
  33. command("PUBLISH" "F2B_CHANNEL" "$(sanitize $MESSAGE)")
  34. );
  35. };
  36. filter f_mail { facility(mail); };
  37. filter f_replica {
  38. not match("User has no mail_replica in userdb" value("MESSAGE"));
  39. not match("Error: sync: Unknown user in remote" value("MESSAGE"));
  40. };
  41. log {
  42. source(s_dgram);
  43. filter(f_replica);
  44. destination(d_stdout);
  45. filter(f_mail);
  46. destination(d_redis_ui_log);
  47. destination(d_redis_f2b_channel);
  48. };