HAProxy Enterprise Documentation 2.7r1

get map

Test whether an input matches an entry in a map file.

Description

This command returns a result that indicates whether an input matches an entry in a map file. This is useful for debugging maps.

Examples

  1. Pass the map ID and an input string to get map to test whether the string matches any keys.

    Assume we have this map file:

    /cart/     cart_api
    /reviews/  reviews_api

    Test whether the input string /reviews/war-and-peace/1 matches any keys:

    $ echo "get map #0 /reviews/war-and-peace/1" | \
       sudo socat stdio unix-connect:/var/run/hapee-2.7/hapee-lb.sock
    type=beg, case=sensitive, found=yes, idx=tree, key="/reviews/", value="reviews_api", type="str"

    The result indicates that a match was found using the type beg, which means begins with. It matched the key /reviews/.

See also


Next up

get var