HAProxy Enterprise Documentation 2.4r1

add map

Add an entry to a Map file.

Description

A Map file contains a list of key-value pairs. You can reference the file on an acl line by using the -M and -f /path/to/file flags. Use add map to add a new entry to a Map file. Note that this only adds it to HAProxy Enterprise's runtime memory and not to the file on disk.

Examples

In this example, the key foo.example.com and value be_bar are added as a new line in the file /etc/hapee-2.4/maps/hosts.map.

$ echo "add map /etc/hapee-2.4/maps/hosts.map foo.example.com be_bar" | \
   sudo socat stdio unix-connect:/var/run/hapee-2.4/hapee-lb.sock

In this example, the key foo.example.com is modified in version 3, an uncommitted temporary file, of the map file indicated by ID 2:

$ echo "add map @3 #2 foo.example.com be_bar" | \
   sudo socat stdio unix-connect:/var/run/hapee-2.4/hapee-lb.sock

See also


Next up

add server