On Thu, 4 Mar 2021 at 13:49, Adis Nezirovic <[email protected]> wrote:
> On 3/4/21 1:39 PM, Mihaly Zachar wrote: > > Dear Adis, > > > > Thank you very much for the prompt answer. It looks promising. > > Yes, I do have the TXN object available. > > > > Currently I am checking the doc here: > > http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#8.2.4 > > <http://cbonte.github.io/haproxy-dconv/2.2/configuration.html#8.2.4> > > > > How can I use the sent back variable I don't see that in the variable > > table :( > > > > Thank > > > You have a few examples in our blog post: > https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/ > > Basically, like using variables in HAProxy config, you need to set > variable name using "scope.name" syntax, e.g. in the example scope is > "req" (request), variable value is false. > > txn:set_var('req.blocked', false) > > Then, it should be able to log that variable by adding a block in > log-format (no need to "capture" anything or similar): > > log-format "%{+Q}[var(txn.MyVar)]" > > A few blog posts about logging: > https://www.haproxy.com/blog/introduction-to-haproxy-logging/ > https://www.haproxy.com/blog/haproxy-log-customization/ Dear Adis, Sorry, my previous email was sent to you rather than to the list. Thank you very much, this is what I did look for ! Great stuff, happy days. Thanks, Misi

