HAProxy Enterprise Documentation 2.5r1

set map

Change the value of a map file entry.

Used by itself, the set map command changes only one map entry at a time, and the change becomes effective immediately. If, on the other hand, you need to change multiple entries, and you need them to be applied all at the same time in one atomic change, submit them as part of a multiple-change transaction initiated with the prepare map command and committed with the commit map command.


Use set map to find an entry in a map file and replace its value.


  1. Pass to the set map command the map's ID, the key in the map to find, and a value that should replace the existing value.

    Alternatively, use the map file's path instead of its ID.

    In the example below, we replace the value cart_api with web_servers for the key /cart/:

    $ echo "set map #0 /cart/ web_servers" | \
       sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock

See also

Next up

set maxconn frontend