From: Herve COMMOWICK Date: Fri, 5 Aug 2016 10:01:20 +0000 (+0200) Subject: DOC: fix json converter example and error message X-Git-Tag: v1.7-dev4~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dfe863fbfc3d1122620f872d33e414e75183ae5;p=thirdparty%2Fhaproxy.git DOC: fix json converter example and error message --- diff --git a/doc/configuration.txt b/doc/configuration.txt index fc98e5c5d7..2a2abd45a2 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -11963,7 +11963,7 @@ ipmask() json([]) Escapes the input string and produces an ASCII ouput string ready to use as a JSON string. The converter tries to decode the input string according to the - parameter. It can be "ascii", "utf8", "utf8s", "utf8"" or + parameter. It can be "ascii", "utf8", "utf8s", "utf8p" or "utf8ps". The "ascii" decoder never fails. The "utf8" decoder detects 3 types of errors: - bad UTF-8 sequence (lone continuation byte, bad number of continuation @@ -11989,9 +11989,9 @@ json([]) logging to servers which consume JSON-formated traffic logs. Example: - capture request header user-agent len 150 capture request header Host len 15 - log-format {"ip":"%[src]","user-agent":"%[capture.req.hdr(1),json("utf8s")]"} + capture request header user-agent len 150 + log-format '{"ip":"%[src]","user-agent":"%[capture.req.hdr(1),json(utf8s)]"}' Input request from client 127.0.0.1: GET / HTTP/1.0 diff --git a/src/sample.c b/src/sample.c index 9e6baa847a..645cb81217 100644 --- a/src/sample.c +++ b/src/sample.c @@ -1643,7 +1643,7 @@ static int sample_conv_json_check(struct arg *arg, struct sample_conv *conv, } memprintf(err, "Unexpected input code type at file '%s', line %d. " - "Allowed value are 'ascii', 'utf8', 'utf8p' and 'utf8pp'", file, line); + "Allowed value are 'ascii', 'utf8', 'utf8s', 'utf8p' and 'utf8ps'", file, line); return 0; }