syslog-ng-redis_slave.conf 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. @version: 3.38
  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_SLAVEOF_IP`")
  23. persist-name("redis1")
  24. port(`REDIS_SLAVEOF_PORT`)
  25. auth("`REDISPASS`")
  26. command("LPUSH" "SOGO_LOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n")
  27. );
  28. };
  29. destination d_redis_f2b_channel {
  30. redis(
  31. host("`REDIS_SLAVEOF_IP`")
  32. persist-name("redis2")
  33. port(`REDIS_SLAVEOF_PORT`)
  34. auth("`REDISPASS`")
  35. command("PUBLISH" "F2B_CHANNEL" "$(sanitize $MESSAGE)")
  36. );
  37. };
  38. log {
  39. source(s_sogo);
  40. destination(d_redis_ui_log);
  41. destination(d_redis_f2b_channel);
  42. };
  43. log {
  44. source(s_sogo);
  45. source(s_src);
  46. destination(d_stdout);
  47. };