Conditional format directives

%stX
Apply %X if the request generated status code st. Use "-" otherwise.
%st1,st2X
Apply %X if the generated status code st1 or st2.
%!stX
Apply %X if the request did not generate status code st. Use "-" otherwise.
%!st1,st2X
Apply %X if the request did not generate status code st1 or st2.
e.g. %400,501{User-agent}i
Record the User-Agent: HTTP header line that for requests that generated status code 400 (Bad request) or 501 (Not implemented).

Contents / Previous / Next