I am trying to use HAProxy's socket API. Specifically, I am trying to read/get the value of an acl using the documentation here.
The error that I keep getting when attempting to run that command is: "Missing ACL identifier and/or key"
I found one forum online where the user seemed to be having the same problem.
I have several acl rules defined in my haproxy.cfg file. I cannot retrieve the values of any of them. Here is an example acl similar to the one that I want to retrieve:
acl is_blue always_false
This acl is being used as a flag to use in my condition statements. I will toggle it between always_false and always_true to signify which environment is "live" (blue or green). Please don't get hung up on this type of acl, as I cannot retrieve ANY of my acls - not just this one.
The forum sited above mentioned that I need to use and Id when trying to use 'get acl', but that doesn't work either. I tried to modify the acl, giving it a specific unique id like this:
acl is_blue always_false -u 10
No love.
Has anyone successfully used 'get acl' with HAProxy's socket API? I have found no examples online that have worked for me and I cannot get past this issue.
Sorry to dig up an old question but according to this https://github.com/haproxy/haproxy/blob/e18db9e984e69e3802868bac10ce0703ce31e7d0/doc/management.txt the "get acl" command is used to check whether an ACL matches a certain pattern.
So if I have this ACL:
{ req.cook(SITEID) -m beg test }
Then I get this:
get acl #5 test
type=beg, case=sensitive, match=yes, idx=tree, pattern="test"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With