Access to LOG variables in LUA

Hi, is there any way to access Log Variables, inside lua script ? perhaps in txn class ?

Thanks

Hi,

I need to access log-format variables from lua script too. The only working solution so far is to set response header, then pass it as txn. variable like this:

haproxy frontend config:

http-response set-header X-Upstream-IP %si
http-response set-var(txn.upstream_ip) res.hdr(X-Upstream-IP)

lua script:

local upstream_ip = txn.get_var(txn, “txn.upstream_ip”)

But this leaves X-Upstream-IP header visible to end user. How could I use http-response set-var() directly with any combination of log-format variables? Use of

http-response set-var(txn.upstream_ip) %si

isn’t allowed.