HAProxy community

HTTP return code in logs -1 and 0


I’ve inherited a custom build HAproxy log analysis tool. This tool extracts the HTTP return code (and other stuff) from the log lines. This tool either accepts a three digit number or -1 as HTTP return code. I’ve been looking into this tool because it now sometimes fails on log lines that have a HTTP return code 0. I’m having a hard time figuring out what the values -1 and 0 stand for. What do these values stand for?


sounds strange. i’ve scanned my logs and couldn’t find one occurrence of a non-three-digit HTTP return code.
perhaps you also have a custom log format, or are parsing it wrong:
have a look at http://www.haproxy.org/download/1.6/doc/configuration.txt 8.2.3. HTTP log format

can you share some loglines?


It’s no custom format. Just the HTTP log format. Some examples:

<190>Mar 1 11:26:09 haproxy[23555]: [01/Mar/2016:11:26:09.059] some-in backend/server1 0/0/0/-1/23 0 25 - - CD-- 6/6/6/6/0 0/0 “POST /some/url HTTP/1.1”
<190>Mar 1 08:08:59 haproxy[5209]: [01/Mar/2016:08:08:59.273] some-in backend/server1 0/0/0/-1/16 0 25 - - CD-- 6/6/6/6/0 0/0 “POST /some/url HTTP/1.1”
<190>Feb 29 18:57:34 haproxy[533]: [29/Feb/2016:18:57:34.532] some-in backen/server1 0/9/0/-1/11 0 25 - - CD-- 12/12/12/7/0 0/5 “POST /some/url HTTP/1.1”

I wasn’t able to find any -1 examples, going to keep looking.