syslog-ng.conf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. source s_sogo {
  17. pipe("/dev/sogo_log" owner(sogo) group(sogo));
  18. };
  19. destination d_stdout { pipe("/dev/stdout"); };
  20. destination d_redis_ui_log {
  21. redis(
  22. host("redis-mailcow")
  23. persist-name("redis1")
  24. port(6379)
  25. command("LPUSH" "SOGO_LOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
  26. );
  27. };
  28. destination d_redis_f2b_channel {
  29. redis(
  30. host("redis-mailcow")
  31. persist-name("redis2")
  32. port(6379)
  33. command("PUBLISH" "F2B_CHANNEL" "$MESSAGE")
  34. );
  35. };
  36. destination d_redis_cleanup {
  37. redis(
  38. host("redis-mailcow")
  39. persist-name("redis3")
  40. port(6379)
  41. command("LTRIM" "SOGO_LOG" "0" "`LOG_LINES`")
  42. );
  43. };
  44. log {
  45. source(s_sogo);
  46. destination(d_redis_ui_log);
  47. destination(d_redis_f2b_channel);
  48. destination(d_redis_cleanup);
  49. };
  50. log {
  51. source(s_sogo);
  52. source(s_src);
  53. destination(d_stdout);
  54. };