Last active
May 22, 2019 13:14
-
-
Save mustafauysal/9e9a070fbaaeee785b1c75c312ac425e to your computer and use it in GitHub Desktop.
HAProxy to Graylog
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
# Create an additional socket in haproxy's chroot in order to allow logging via | |
# /dev/log to chroot'ed HAProxy processes | |
$template GRAYLOGRFC5424,"<%PRI%>%PROTOCOL-VERSION% %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n" | |
$AddUnixListenSocket /var/lib/haproxy/dev/log | |
# Send HAProxy messages to a dedicated logfile | |
if $programname startswith 'haproxy' then /var/log/haproxy.log | |
if $syslogtag contains 'haproxy' then @192.168.1.10:1514;GRAYLOGRFC5424 | |
&~ |
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
. | |
. | |
. | |
defaults | |
mode http | |
log global | |
log-format {"haproxy_clientIP":"%ci","haproxy_clientPort":"%cp","haproxy_dateTime":"%t","haproxy_frontendNameTransport":"%ft","haproxy_backend":"%b","haproxy_serverName":"%s","haproxy_Tw":"%Tw","haproxy_Tc":"%Tc","haproxy_Tt":"%Tt","haproxy_bytesRead":"%B","haproxy_terminationState":"%ts","haproxy_actconn":%ac,"haproxy_FrontendCurrentConn":%fc,"haproxy_backendCurrentConn":%bc,"haproxy_serverConcurrentConn":%sc,"haproxy_retries":%rc,"haproxy_srvQueue":%sq,"haproxy_backendQueue":%bq,"haproxy_backendSourceIP":"%bi","haproxy_backendSourcePort":"%bp"} | |
option httplog | |
. | |
. | |
. | |
. | |
. | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment