Hi Baptise, Using set-map on the stats socket gives the expected result (except that I can't use functions there). set map motion.map monday 12345 did set the map with key monday and value as 12345.
I found that "http-request set-map(motion.map) monday %[date]" doesn't work, but "http-request set-map(motion.map) %t" does work. Using %T, %TL, %t works as expected but %[date] doesn't. Moreover, I am getting crazy results when I try to use "http-request set-map(motion.map) monday %[src]". Using this makes both key and value as src. BTW, I am using HA-Proxy version 1.5.11 2015/01/31 Copyright 2000-2015 Willy Tarreau <[email protected]> Build options : TARGET = linux2628 CPU = generic CC = gcc CFLAGS = -O2 -g -fno-strict-aliasing OPTIONS = USE_ZLIB=1 USE_OPENSSL=1 USE_STATIC_PCRE=1 Default settings : maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents = 200 Encrypted password support via crypt(3): yes Built with zlib version : 1.2.8 Compression algorithms supported : identity, deflate, gzip Built with OpenSSL version : OpenSSL 1.0.1f 6 Jan 2014 Running on OpenSSL version : OpenSSL 1.0.1f 6 Jan 2014 OpenSSL library supports TLS extensions : yes OpenSSL library supports SNI : yes OpenSSL library supports prefer-server-ciphers : yes Built with PCRE version : 8.31 2012-07-06 PCRE library supports JIT : no (USE_PCRE_JIT not set) Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND Available polling systems : epoll : pref=300, test result OK poll : pref=200, test result OK select : pref=150, test result OK Total: 3 (3 usable), will use epoll. On Sat, Feb 28, 2015 at 1:26 AM, Baptiste <[email protected]> wrote: > On Sat, Feb 28, 2015 at 3:22 AM, Vivek Malik <[email protected]> wrote: >> (Sorry for pressing send too early) >> >> Hi, >> >> I am trying to use http-request set-map with fixed strings which are >> defined in config file. Example lines >> >> http-request set-map(motion.map) monday %[date()] if acl_1 >> http-request set-map(motion.map) tuesday %[date()] if acl_2 >> >> Note that monday and tuesday are literal string and not log-format >> variables. However, when I look into the map using >> >> echo "show map motion.map" | socat stdio /var/run/socket-haproxy >> 0x13c1b90 1425089705 >> >> As you can see, the key is missing from the map. "monday" is getting >> replaced by space " " >> >> However, if I switch the format to >> http-request set-map(motion.map) %[date()] monday if acl_1 >> >> such that the literal string "monday" is a value instead of key, the >> set-map works fine. >> >> echo "show map motion.map" | socat stdio /var/run/socket-haproxy >> 0x13c1b90 1425089710 monday >> >> >> Please suggest if I have stumbled across a bug or I am missing >> something in my configuration. >> > > > Hi Vivek, > > could you try the 'set-map' on the stats socket directly and report if > you have the same result or not? > > Baptiste

