Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
f2cf2eaf
Commit
f2cf2eaf
authored
May 27, 2014
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep the list of ncsa format specifiers in one location only
Other minor cleanups
parent
f53ff463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
34 deletions
+14
-34
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+11
-31
varnishncsa.rst
doc/sphinx/reference/varnishncsa.rst
+3
-3
No files found.
bin/varnishncsa/varnishncsa.c
View file @
f2cf2eaf
...
...
@@ -30,32 +30,12 @@
* SUCH DAMAGE.
*
* Obtain log data from the shared memory log, order it by session ID, and
* display it in Apache / NCSA combined log format
:
* display it in Apache / NCSA combined log format
.
*
* %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"
* See doc/sphinx/reference/varnishncsa.rst for the supported format
* specifiers.
*
* where the fields are defined as follows:
*
* %h Client host name or IP address (always the latter)
* %l Client user ID as reported by identd (always "-")
* %u User ID if using HTTP authentication, or "-"
* %t Date and time of request
* %r Request line
* %s Status code
* %b Length of reply body, or "-"
* %{Referer}i Contents of "Referer" request header
* %{User-agent}i Contents of "User-agent" request header
* %I Total bytes recieved from client
* %O Total bytes sent to client
*
* Actually, we cheat a little and replace "%r" with something close to
* "%m http://%{Host}i%U%q %H", where the additional fields are:
*
* %m Request method
* %{Host}i Contents of "Host" request header
* %U URL path
* %q Query string
* %H Protocol version
* Note: %r is "%m http://%{Host}i%U%q %H"
*
*/
...
...
@@ -551,12 +531,18 @@ parse_format(const char *format)
case
'H'
:
/* Protocol */
addf_fragment
(
&
CTX
.
frag
[
F_H
],
"HTTP/1.0"
);
break
;
case
'I'
:
/* Bytes recieved */
addf_fragment
(
&
CTX
.
frag
[
F_I
],
"-"
);
break
;
case
'l'
:
/* Client user ID (identd) always '-' */
AZ
(
VSB_putc
(
vsb
,
'-'
));
break
;
case
'm'
:
/* Method */
addf_fragment
(
&
CTX
.
frag
[
F_m
],
"-"
);
break
;
case
'O'
:
/* Bytes sent */
addf_fragment
(
&
CTX
.
frag
[
F_O
],
"-"
);
break
;
case
'q'
:
/* Query string */
addf_fragment
(
&
CTX
.
frag
[
F_q
],
""
);
break
;
...
...
@@ -572,18 +558,12 @@ parse_format(const char *format)
case
'T'
:
/* Int request time */
addf_time
(
*
p
,
NULL
,
NULL
);
break
;
case
'u'
:
case
'u'
:
/* Remote user from auth */
addf_auth
(
"-"
);
break
;
case
'U'
:
/* URL */
addf_fragment
(
&
CTX
.
frag
[
F_U
],
"-"
);
break
;
case
'I'
:
/* Bytes recieved */
addf_fragment
(
&
CTX
.
frag
[
F_I
],
"-"
);
break
;
case
'O'
:
/* Bytes sent */
addf_fragment
(
&
CTX
.
frag
[
F_O
],
"-"
);
break
;
case
'{'
:
p
++
;
q
=
p
;
...
...
doc/sphinx/reference/varnishncsa.rst
View file @
f2cf2eaf
...
...
@@ -69,15 +69,15 @@ Supported formatters are:
%m
Request method. Defaults to '-' if not known.
%q
The query string, if no query string exists, an empty string.
%{X}o
The contents of response header X.
%O
Total bytes sent to client.
%q
The query string, if no query string exists, an empty string.
%r
The first line of the request. Synthesized from other fields, so it
may not be the request verbatim.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment