On Tue, Dec 01, 2020 at 07:55:10AM +0100, Maciej Zdeb wrote:
> Even with mode http:
> 
> defaults
> mode http
> log stdout local0
> log-format 'path:%[path]'
> 
> it still fails.
> 
> What is more even if you use %[path] on http frontend:
> 
> defaults
> mode http
> log stdout local0
> 
> frontend front
>     mode http
> # http-request set-var(txn.path) path
> # log-format 'path:%[var(txn.path)]'
>     log-format 'path:%[path]'
>     bind 127.0.0.1:8888
>     default_backend back
> backend back
>     mode http
>     server srv 127.0.0.1:80 check
> 
> it will also fail. The only way I know for using fetches in log-format is
> through set-var()/var() (commented lines in above config).

Ah I'm stupid, sorry! The problem is not caused by the defaults section
but by the fact that %[path] extracts the path from the request while your
proposal takes it from the copy of the URI that was kept for logging.

OK, at first glance your patch looks good. However the description of
the token doesn't seem perfect. Given that we already use the terminology
"path", I'd rather make it clear that it's the patth. What about, for
example, "%HPO" for "HTTP path only (without host nor query string)" ?

Thanks,
Willy

Reply via email to