# Config file for haproxy logs

**URL:** <https://community.graylog.org/t/config-file-for-haproxy-logs/21001>\
**Category:** Graylog Tech Challenges\
**Created:** [August 26, 2021, 12:17pm UTC](https://community.graylog.org/t/config-file-for-haproxy-logs/21001 "2021-08-26T12:17:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tor](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tor](https://community.graylog.org/u/tor)\
**Post date:** [August 26, 2021, 12:17pm UTC](https://community.graylog.org/t/config-file-for-haproxy-logs/21001/1 "2021-08-26T12:17:07Z")

</div>

Currently I have my haproxy traffic logs going into gray log but my system logs for that server are not.  
here is my .conf file. Where have a I gone wrong? If i move the system log line to the top then that works but haproxy traffic logs stop then and vice vera.

$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.14.148:10514;GRAYLOGRFC5424

_._ @@192.168.14.148:10514;RSYSLOG\_SyslogProtocol23Format

---

<div class="post-metadata">

**Author:** ![tor](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tor](https://community.graylog.org/u/tor)\
**Post date:** [August 26, 2021, 1:47pm UTC](https://community.graylog.org/t/config-file-for-haproxy-logs/21001/2 "2021-08-26T13:47:48Z")

</div>

I think i worked that out by having 2 config files one for syslog and other for the haproxy part then it seems to log both.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [September 9, 2021, 1:48pm UTC](https://community.graylog.org/t/config-file-for-haproxy-logs/21001/3 "2021-09-09T13:48:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
