Hi,
On Wed, May 09, Simon Schabel wrote:
> We use the req.body_param([<name>]) setting to retrieve body
> parameter from the incoming HTTP queries and place them into the
> logs.
>
> Unfortunately this only works with HTTP POST requests. In our case
> we need to extract the parameter from PUT requests as well.
>
> Would it be an option to use req.body_param([<name>]) on any HTTP
> method type instead of restricting it to HTTP POST?
Can you share your haproxy -vv and the logging config ?
I just tested with haproxy-ss-20180507 and this minimal test
seems to get req.body_param(log) to stick table on both POST/PUT requests
(tested w/curl -X PUT|POST):
...
frontend test
option http-buffer-request
bind [email protected]:8080
http-request track-sc2 req.body_param(log),lower table test_be if
METH_POST || METH_PUT
default_backend test_be
backend test_be
stick-table type string len 48 size 64 expire 240s store http_req_cnt
server wp2 some.ip.add.ress:80 id 2
...
curl -X PUT -d'log=user1' http://127.0.0.1:8080/
curl -X POST -d'log=user2' http://127.0.0.1:8080/
-Jarno
--
Jarno Huuskonen