mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
DOC: fix json converter example and error message
This commit is contained in:
parent
b84ae92615
commit
8dfe863fbf
@ -11963,7 +11963,7 @@ ipmask(<mask>)
|
|||||||
json([<input-code>])
|
json([<input-code>])
|
||||||
Escapes the input string and produces an ASCII ouput string ready to use as a
|
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
|
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
|
"utf8ps". The "ascii" decoder never fails. The "utf8" decoder detects 3 types
|
||||||
of errors:
|
of errors:
|
||||||
- bad UTF-8 sequence (lone continuation byte, bad number of continuation
|
- 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.
|
logging to servers which consume JSON-formated traffic logs.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
capture request header user-agent len 150
|
|
||||||
capture request header Host len 15
|
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:
|
Input request from client 127.0.0.1:
|
||||||
GET / HTTP/1.0
|
GET / HTTP/1.0
|
||||||
|
@ -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. "
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user