Hello Ricardo,
On Fri, Jul 24, 2020 at 10:36:59AM +0200, Ricardo Fraile wrote:
(...)
> I think that the "set-var" way is more flexible, as you can combine it with
> any other variable that helps to identify the client request. The proposed
> "here" converter can helps more.
OK, I'll try to think about it more.
> As an idea, it would be nice if these debug modifications done over the ACLs
> can be logged based on a condition, for example only with a particular
> client pattern, something like:
>
> acl client_debug hdr_sub(User-Agent) client1-user-agent
> log-format %ci,%[var(txn.last_expr)] if client_debug
You cannot condition a log format versus another one, but what you can
do is use an intermediary variable:
acl client_debug hdr_sub(User-Agent) client1-user-agent
http-request ser-var(txn.debug_expr) var(txn.last_expr) if client_debug
log-format %ci,%[var(txn.debug_expr)]
=> your debug_expr variable will only be set if client_debug is true,
otherwise it will log an empty string.
Willy