I am configuring a haproxy instance so that I can reverse some services from one network to another, in particular I followed this guide https://www.haproxy.com/documentation/haproxy-configuration-tutorials/syslog-forwarding/ to forward the syslog logs to syslog-ng but they don't arrive with the correct IP address but with the one which is the gateway that routes on the syslog-ng network
Haproxy
Syslog-ng
Haproxy
Code:
global
log ring@logbuffer local5
daemon
maxconn 256
defaults
log global
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
log-format "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts %ac/%fc/%bc/%sc/%rc %sq/%bq"
log-forward syslog
# Accepts incoming TCP messages
bind 192.168.16.46:1514
# Accepts incoming UDP messages
dgram-bind 192.168.16.46:1514
# Sends outgoing messages via UDP
log ring@logbuffer local0
ring logbuffer
description "buffer for logs"
format rfc5424
maxlen 1500
size 65536
timeout connect 10s
timeout server 20s
# Sends outgoing messages via TCP
server logserver 192.168.10.21:1514 check send-proxy-v2
Syslog-ng
Code:
source s_remote {
tcp(port(1514));
};
destination d_remote {
file(
"/var/log/remote/${HOST}/${YEAR}_${MONTH}_${DAY}.log"
create-dirs(yes)
);
};
log {
source(s_remote);
destination(d_remote);
};