8000 Date formulas are not valid in custom error logs · Issue #2884 · haproxy/haproxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
  • Insights
  • Date formulas are not valid in custom error logs #2884
    Closed
    @allegrox

    Description

    @allegrox

    Detailed Description of the Problem

    When I use a date formula in a custom error log, the date field is not output in the log. But the output is correct when using date variable (%t). The date formula u 8B4C sed here is the one that corresponds to the date variable in the official documentation (https://docs.haproxy.org/3.0/configuration.html#8.2.6).

    Expected Behavior

    date formulas are not valid in custom error logs

    Steps to Reproduce the Behavior

    Stable reproduction:

        error-log-format "%ci [%[accept_date(ms),ms_ltime("%d/%b/%Y:%H:%M:%S.%3N")] %ft:%fp %ac/%fc %[fc_err_name]/% ssl_fc_err_str]"
    

    no date in log

        error-log-format "%ci [%t] %ft:%fp %ac/%fc %[fc_err_name]/%[ssl_fc_err_str]"
    

    There's date in the log.

    Do you have any idea what may have caused this?

    No response

    Do you have an idea how to solve the issue?

    No response

    What is your configuration?

    global
        daemon
        maxconn 40960
    # enable the following directives for openssl 1.1.1+
    #    ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11
    #    ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256
    #    ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
    #    tune.ssl.default-dh-param 2048
        log /dev/log format iso local0 info
    
    defaults
        option dontlognull
        timeout connect   5s
        timeout client   30s
        timeout client-fin 30s
        timeout server   30s
        timeout tunnel   90s
    
    listen http-in
        mode http
        log global
        log-format "%ci [%[accept_date(ms),ms_ltime("%Y-%m-%dT%H:%M:%S.%3N%z")]] %ft:%fp \"%r\" %ST %B %ts %Ta/%Tt %ac/%fc/%bc %si:%sp %hrl"
    #    error-log-format "%ci [%[accept_date(ms),ms_ltime("%Y-%m-%dT%H:%M:%S.%3N%z")]] %ft:%fp %ac/%fc %[fc_err_name]/%[ssl_fc_err_str]"
        error-log-format "%ci [%t] %ft:%fp %ac/%fc %[fc_err_name]/%[ssl_fc_err_str]"
        capture request header ztid len 32
        option forwardfor
        bind *:8000-8199 ssl crt /etc/haproxy/cert ssl-min-ver TLSv1.2
        server server1 x.x.x.x
    
    ![Image](https://github.com/user-attachments/assets/e72105b9-459f-402e-8344-4e302a6ab419)
    
     ssl verify none
    
    listen tcp-in
        mode tcp
        log global
        log-format "%ci [%[accept_date(ms),ms_ltime("%Y-%m-%dT%H:%M:%S.%3N%z")]] %ft:%fp %B/%U %ts %Tw/%Tc/%Tt %ac/%fc/%bc"
        error-log-format "%ci [%[accept_date(ms),ms_ltime("%Y-%m-%dT%H:%M:%S.%3N%z")]] %ft:%fp %ts %ac/%fc"
        bind *:8500-8699
        server server1 x.x.x.x

    Output of haproxy -vv

    HAProxy version 3.0.8-6036c31 2025/01/29 - https://haproxy.org/
    Status: long-term supported branch - will stop receiving fixes around Q2 2029.
    Known bugs: http://www.haproxy.org/bugs/bugs-3.0.8.html
    Running on: Linux 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
    Build options :
      TARGET  = linux-glibc
      CC      = cc
      CFLAGS  = -O2 -g -fwrapv
      OPTIONS = USE_OPENSSL=1 USE_ZLIB=1 USE_CPU_AFFINITY=1 USE_SYSTEMD=1 USE_PCRE=1
      DEBUG   = 
    
    Feature list : -51DEGREES +ACCEPT4 +BACKTRACE -CLOSEFROM +CPU_AFFINITY +CRYPT_H -DEVICEATLAS +DL -ENGINE +EPOLL -EVPORTS +GETADDRINFO -KQUEUE -LIBATOMIC +LIBCRYPT +LINUX_CAP +LINUX_SPLICE +LINUX_TPROXY -LUA -MATH -MEMORY_PROFILING +NETFILTER +NS -OBSOLETE_LINKER +OPENSSL -OPENSSL_AWSLC -OPENSSL_WOLFSSL -OT +PCRE -PCRE2 -PCRE2_JIT -PCRE_JIT +POLL +PRCTL -PROCCTL -PROMEX -PTHREAD_EMULATION -QUIC -QUIC_OPENSSL_COMPAT +RT +SHM_OPEN -SLZ +SSL -STATIC_PCRE -STATIC_PCRE2 +SYSTEMD +TFO +THREAD +THREAD_DUMP +TPROXY -WURFL +ZLIB
    
    Default settings :
      bufsize = 16384, maxrewrite = 1024, maxpollevents = 200
    
    Built with multi-threading support (MAX_TGROUPS=16, MAX_THREADS=256, default=2).
    Built with OpenSSL version : OpenSSL 1.0.2k-fips  26 Jan 2017
    Running on OpenSSL version : OpenSSL 1.0.2k-fips  26 Jan 2017
    OpenSSL library supports TLS extensions : yes
    OpenSSL library supports SNI : yes
    OpenSSL library supports : SSLv3 TLSv1.0 TLSv1.1 TLSv1.2
    Built with network namespace support.
    Built with zlib version : 1.2.7
    Running on zlib version : 1.2.7
    Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
    Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND
    Built with PCRE version : 8.32 2012-11-30
    Running on PCRE version : 8.32 2012-11-30
    PCRE library supports JIT : no (USE_PCRE_JIT not set)
    Encrypted password support via crypt(3): yes
    Built with gcc compiler version 4.8.5 20150623 (Red Hat 4.8.5-44)
    
    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=HTTP  side=FE|BE  mux=H2    flags=HTX|HOL_RISK|NO_UPG
      <default> : mode=HTTP  side=FE|BE  mux=H1    flags=HTX
             h1 : mode=HTTP  side=FE|BE  mux=H1    flags=HTX|NO_UPG
           fcgi : mode=HTTP  side=BE     mux=FCGI  flags=HTX|HOL_RISK|NO_UPG
      <default> : mode=TCP   side=FE|BE  mux=PASS  flags=
           none : mode=TCP   side=FE|BE  mux=PASS  flags=NO_UPG
    
    Available services : none
    
    Available filters :
    	[BWLIM] bwlim-in
    	[BWLIM] bwlim-out
    	[CACHE] cache
    	[COMP] compression
    	[FCGI] fcgi-app
    	[SPOE] spoe
    	[TRACE] trace
    

    Last Outputs and Backtraces

    
    

    Additional Information

    No response

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      status: feedback requiredThe developers are waiting for a reply from the reporter.status: fixedThis issue is a now-fixed bug.

      Type

      No type

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        0