Created
July 29, 2022 15:11
-
-
Save haproxytechblog/4640068b8720064181ee876bf948f2c0 to your computer and use it in GitHub Desktop.
Log Forwarding with HAProxy and Syslog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log-forward syslog | |
# Accepts incoming TCP messages | |
bind 0.0.0.0:514 | |
# Accepts incoming UDP messages | |
dgram-bind 0.0.0.0:514 | |
# Sends outgoing messages via UDP | |
log 172.25.0.12:514 local0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log-forward syslog | |
bind 0.0.0.0:514 | |
dgram-bind 0.0.0.0:514 | |
log ring@logbuffer local0 | |
ring logbuffer | |
description "buffer for logs" | |
format rfc5424 | |
maxlen 1200 | |
size 32764 | |
timeout connect 5s | |
timeout server 10s | |
# Sends outgoing messages via TCP | |
server logserver 172.25.0.12:514 check |
Certainly, it could be that the log-forward section does not yet have a feature to preserve the client IP, but could be worthwhile to add it as a feature request on the HAProxy GitHub.
Sorry but it makes little sense that you don't send any identifier of the machine that will generate the log. if I activate syslog on 4 switches for example and I want to use haproxy as reverse and cache forward towards my syslog do I need to know which switch generated the log?
Did you find any solution to the originating source IP?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm trying this configuration, the problem I have is that the logs to the syslog all come to me with the IP address of the haproxy machine and host host_from etc... and I can't find an option to pass the IP address of the client that works with log- forward