Open anandcta123 opened 7 months ago
Since 2.9 you may use core.get_var()
method to fetch variables from proc.*
scope: https://www.arpalert.org/src/haproxy-lua-api/3.0/index.html#core.get_var
For now there is no core.set_var()
so you cannot set proc.*
variables outside of TXN context, see #2212
However you may set global Lua variables within your script and register custom Lua fetches to return desired values and use the fetch results from haproxy configuration. See https://www.arpalert.org/src/haproxy-lua-api/3.0/index.html#core.register_fetches
In the end there doesn't seem to be an actual bug or issue on haproxy side, thus if you need more assistance to solve your use-case feel to ask for help on the community forum (https://discourse.haproxy.org/) or on the mailing list (https://www.haproxy.org/#tact), some users probably faced similar challenges and may be able to help you.
Hope this helps
Can we close the issue or should we change it to a feature request ?
Detailed Description of the Problem
I am planning to read a configuration file. Within an action, trying to open a JSON file gives me error and with register_init function, it works. But using register_init, I am not receiving txn object, so not understanding how we can set variables or read variables in init context.
Expected Behavior
Need to understand, is there any way to manipulate global variables in register_init.
Steps to Reproduce the Behavior
Nothing to reproduce, trying to understand, is there any possibility to set/get variables.
Do you have any idea what may have caused this?
NO
Do you have an idea how to solve the issue?
NO
What is your configuration?
Output of
haproxy -vv
Last Outputs and Backtraces
No response
Additional Information
No response