Re: How to log %[hdr_ip(X-Forwarded-For,-1)]

2019-12-02 Thread Aleksandar Lazic
s Thanks. JWD *From:* Aleksandar Lazic <mailto:al-hapr...@none.at> *Date:* 2019-12-02 18:42 *To:* JWD <mailto:j...@163.com>; haproxy <mailto:haproxy@formilux.org> *Subject:* Re: How to log %[hdr_ip

Re: How to log %[hdr_ip(X-Forwarded-For,-1)]

2019-12-02 Thread Aleksandar Lazic
Hi. Am 02.12.2019 um 09:27 schrieb JWD: Hi,all I want to write %[hdr_ip(X-Forwarded-For,-1)] to log, how to do that? And how to log it with [if] confition? Like set-header below: http-request set-header X-Client-IP %[hdr_ip(X-Forwarded-For,-1)] if !{  hdr(X-Client-IP) -m found } { hdr(X

How to log %[hdr_ip(X-Forwarded-For,-1)]

2019-12-02 Thread JWD
Hi,all I want to write %[hdr_ip(X-Forwarded-For,-1)] to log, how to do that? And how to log it with [if] confition? Like set-header below: http-request set-header X-Client-IP %[hdr_ip(X-Forwarded-For,-1)] if !{ hdr(X-Client-IP) -m found } { hdr(X-Forwarded-For) -m found } http-request