HAProxy Enterprise Documentation 2.7r1

get acl

Test whether a value would match an ACL.

Description

This command returns a result that indicates whether a value would match an ACL expression. An ACL is found by its ID, which comes from the output of the command show acl. This is useful for debugging ACLs.

Examples

We start with the following ACL expression in the configuration, which checks whether the requested URL path begins with /images/:

frontend www
   bind :80
   acl static_url path -i -m beg /images/
  1. Test a value against an ACL that you reference by its ID.

    In the example below, we test the value /images/test.jpg against the ACL with an ID of 0:

    $ echo "get acl #0 /images/test.jpg" | \
       sudo socat stdio unix-connect:/var/run/hapee-2.7/hapee-lb.sock
    type=beg, case=insensitive, match=yes, idx=list, pattern="/images/"

    It returns match=yes.

See also


Next up

get map