syslog-ng.conf 961 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @version: 3.8
  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. bad_hostname("^gconfd$");
  11. };
  12. source s_src {
  13. unix-stream("/dev/log");
  14. internal();
  15. };
  16. destination d_stdout { pipe("/dev/stdout"); };
  17. destination d_redis_ui_log {
  18. redis(
  19. host("redis-mailcow")
  20. persist-name("redis1")
  21. port(6379)
  22. command("LPUSH" "DOVECOT_MAILLOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
  23. command("LTRIM" "DOVECOT_MAILLOG" "0" "10000")
  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" "$MESSAGE")
  32. );
  33. };
  34. filter f_mail { facility(mail); };
  35. log {
  36. source(s_src);
  37. destination(d_stdout);
  38. filter(f_mail);
  39. destination(d_redis_ui_log);
  40. destination(d_redis_f2b_channel);
  41. };