]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: fix json converter example and error message
authorHerve COMMOWICK <herve.commowick@adobe.com>
Fri, 5 Aug 2016 10:01:20 +0000 (12:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Aug 2016 06:08:18 +0000 (08:08 +0200)
doc/configuration.txt
src/sample.c

index fc98e5c5d7a1c155e9f4358a5c81a063e0cffe50..2a2abd45a2544836b4a4269a71fd2344fc6e699f 100644 (file)
@@ -11963,7 +11963,7 @@ ipmask(<mask>)
 json([<input-code>])
   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
-  <input-code> parameter. It can be "ascii", "utf8", "utf8s", "utf8"" or
+  <input-code> 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([<input-code>])
   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
index 9e6baa847a534a5bc7a28b0fb5fdf7e14f407933..645cb81217867199cc8ec00ab5c43a6f3b62813b 100644 (file)
@@ -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;
 }