syslog-ng.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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-mailcow")
  21. persist-name("redis1")
  22. port(6379)
  23. command("LPUSH" "DOVECOT_MAILLOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
  24. );
  25. };
  26. destination d_redis_f2b_channel {
  27. redis(
  28. host("redis-mailcow")
  29. persist-name("redis2")
  30. port(6379)
  31. command("PUBLISH" "F2B_CHANNEL" "$(sanitize $MESSAGE)")
  32. );
  33. };
  34. filter f_mail { facility(mail); };
  35. filter f_replica {
  36. not match("User has no mail_replica in userdb" value("MESSAGE"));
  37. not match("Error: sync: Unknown user in remote" value("MESSAGE"));
  38. };
  39. log {
  40. source(s_dgram);
  41. filter(f_replica);
  42. destination(d_stdout);
  43. filter(f_mail);
  44. destination(d_redis_ui_log);
  45. destination(d_redis_f2b_channel);
  46. };