Last Updated: February 25, 2016
·
2.092K
· sawanoboly

syslog-ng setting for haproxy tcplog.

template t_haproxy_acc {
  template("$MSG\n");
  template_escape(no);
};

template t_haproxy_sys {
  template("$DATE $HOST $PRIORITY $MSGHDR$MSG\n");
  template_escape(no);
};


destination t_haproxy_acc {
  file(
    "/var/log/haproxy/haproxy_access.log",
    template(t_haproxy_acc));
};

destination t_haproxy_sys {
  file(
    "/var/log/haproxy/haproxy_system.log",
    template(t_haproxy_sys));
};


filter f_haproxy_acc {
  program(haproxy) and level(info);
};

filter f_haproxy_sys {
  program(haproxy) and not level(info);
};


log { source(s_src); filter(f_haproxy_acc); destination(t_haproxy_acc); };
log { source(s_src); filter(f_haproxy_sys); destination(t_haproxy_sys); };