Reference

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. prepare map and commit map are available as of version 2.4r1.

Description Jump to heading

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

Examples Jump to heading

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/:

bash
echo "set map #0 /cart/ web_servers" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "set map #0 /cart/ web_servers" | \
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