Am 26.05.2019 um 21:39 schrieb Willy Tarreau: > Hi Aleks, > > On Sat, May 25, 2019 at 02:59:09PM +0200, Aleksandar Lazic wrote: >> Hi. >> >> attached a patch for the doc to make it clear that for clf are request header >> capture required. > > I'm sorry, but why ? I've already used CLF without captures, it probably > even pre-dates captures. Your addition makes one think it will not work > without. Also the captures will not appear at the location you'd expect > them. Maybe a warning regarding the fact these fields are not logged by > default is more suitable, and maybe even a proposal for an alternate > format supporting this would help.
I'm open for any suggestion. Just to clarify that I don't make any mistakes. I have tested with this minimal setup. ``` haproxy -vv HA-Proxy version 1.9.8-1ppa1~xenial 2019/05/16 - https://haproxy.org/ Build options : TARGET = linux2628 CPU = generic CC = gcc CFLAGS = -O2 -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-old-style-declaration -Wno-ignored-qualifiers -Wno-clobbered -Wno-missing-field-initializers -Wtype-limits OPTIONS = USE_GETADDRINFO=1 USE_ZLIB=1 USE_REGPARM=1 USE_OPENSSL=1 USE_LUA=1 USE_SYSTEMD=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_NS=1 Default settings : maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200 Built with OpenSSL version : OpenSSL 1.0.2g 1 Mar 2016 Running on OpenSSL version : OpenSSL 1.0.2g 1 Mar 2016 OpenSSL library supports TLS extensions : yes OpenSSL library supports SNI : yes OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2 Built with Lua version : Lua 5.3.1 Built with network namespace support. Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND Built with zlib version : 1.2.8 Running on zlib version : 1.2.8 Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip") Built with PCRE2 version : 10.21 2016-01-12 PCRE2 library supports JIT : yes Encrypted password support via crypt(3): yes Built with multi-threading support. Available polling systems : epoll : pref=300, test result OK poll : pref=200, test result OK select : pref=150, test result OK Total: 3 (3 usable), will use epoll. Available multiplexer protocols : (protocols marked as <default> cannot be specified using 'proto' keyword) h2 : mode=HTX side=FE|BE h2 : mode=HTTP side=FE <default> : mode=HTX side=FE|BE <default> : mode=TCP|HTTP side=FE|BE Available filters : [SPOE] spoe [COMP] compression [CACHE] cache [TRACE] trace ``` ``` cat haproxy-logtest.cfg global log stdout format raw daemon debug listen log-test bind :8091 log global mode http option http-use-htx option httplog clf timeout client 30s timeout connect 30s timeout server 30s capture request header Referer len 128 capture request header User-Agent len 128 server google google.com:80 check ``` Without capture header. ``` haproxy -f haproxy-logtest.fg Proxy log-test started. 127.0.0.1 - - [27/May/2019:11:27:35 +0000] "GET / HTTP/1.1" 301 518 "" "" 46722 703 "log-test" "log-test" "google" 0 0 5 39 44 ---- 1 1 0 0 0 0 0 "" "" ``` With capture header. ``` haproxy -f haproxy-logtest.fg Proxy log-test started. 127.0.0.1 - - [27/May/2019:11:30:26 +0000] "GET / HTTP/1.1" 301 518 "" "" 46892 004 "log-test" "log-test" "google" 0 0 5 39 44 ---- 1 1 0 0 0 0 0 "" "" "MyOwn Referer" "curl/7.47.0" ``` > Just my two cents, > Willy >

