Reference

clear acl

Delete all entries from an ACL expression or file.

Description Jump to heading

An ACL is split into four parts:

  • a name for the ACL, which you choose
  • a fetch to collect information from the client’s session
  • optional flags
  • a value to match against

In the example below, we mark these parts:

haproxy
frontend www
bind :80
# name fetch flags value
acl static_url path -i -m beg /images/ /scripts/
haproxy
frontend www
bind :80
# name fetch flags value
acl static_url path -i -m beg /images/ /scripts/

Here, there is initially two values, /images/ and /scripts/. Use clear acl to delete all values.

You can also store values in a file and then reference that file in an acl statement by using the -f /path/to/file flag. Use the clear acl command to delete all values from the file. Note that this only removes it from the load balancer’s runtime memory and not to the file on disk.

Examples Jump to heading

Use clear acl to remove the values /images/ and /scripts/. You can specify the acl file by path or ID. Here we use the ID, which you can get from show acl.

bash
echo "clear acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "clear acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

In the next example, we remove all values from the ACL file /etc/hapee-2.8/paths.acl:

bash
echo "clear acl /etc/hapee-2.8}/paths.acl" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "clear acl /etc/hapee-2.8}/paths.acl" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

Available since

  • HAProxy 2.4
  • HAProxy Enterprise 2.4r1

In this example, we delete all entries from version 3 of the acl file indicated by ID 2:

bash
echo "clear acl @3 #2" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "clear acl @3 #2" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

See also Jump to heading

If this page was useful, please, Leave the feedback.

© 2023 HAProxy Technologies, LLC. All Rights Reserved
Manage Cookie Preferences