]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: add encoding to json converter example
authorMac Browning <mac@digitalocean.com>
Mon, 14 Mar 2016 18:46:01 +0000 (14:46 -0400)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Mar 2016 05:14:41 +0000 (06:14 +0100)
Without the encoding `log-format` will issue a warning like:

$ haproxy -c -f /etc/haproxy/haproxy.cfg
[WARNING] 073/180933 (179) : parsing [/etc/haproxy/haproxy.cfg:46] :
'log-format' : sample fetch <capture.req.hdr(1),json> failed with : missing
args for conv method 'json'

doc/configuration.txt

index dc1a3fce9b425ff71544017c2ea51c2914e7c451..c9cca4fd9759461caaeb938df2406dea3d93161e 100644 (file)
@@ -11784,7 +11784,7 @@ json([<input-code>])
   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]"}
+     log-format {"ip":"%[src]","user-agent":"%[capture.req.hdr(1),json("utf8s")]"}
 
   Input request from client 127.0.0.1:
      GET / HTTP/1.0