1VARNISHTOP(1) VARNISHTOP(1)
2
3
4
6 varnishtop - Varnish log entry ranking
7
9 varnishtop [-1] [-b] [-c] [-C] [-d] [-f] [-g <ses‐
10 sion|request|vxid|raw>] [-h] [-i <taglist>] [-I <[taglist:]regex>] [-L
11 <limit>] [-n <dir>] [-p <period>] [-Q <file>] [-q <query>] [-r <file‐
12 name>] [-t <seconds|off>] [-T <seconds>] [-x <taglist>] [-X
13 <[taglist:]regex>] [-V]
14
16 The varnishtop utility reads varnishd(1) shared memory logs and
17 presents a continuously updated list of the most commonly occurring log
18 entries. With suitable filtering using the -I, -i, -X and -x options,
19 it can be used to display a ranking of requested documents, clients,
20 user agents, or any other information which is recorded in the log.
21
22 The following options are available:
23
24 -1 Instead of a continuously updated display, print the statistics
25 once and exit. Implies -d.
26
27 -b Only display transactions and log records coming from backend
28 communication.
29
30 -c Only display transactions and log records coming from client
31 communication.
32
33 -C Do all regular expression and string matching caseless.
34
35 -d Process log records at the head of the log.
36
37 -f Sort and group only on the first field of each log entry. For
38 log entries in the form prefix: value it is the prefix without
39 the colon that is sorted and grouped. This is useful when dis‐
40 playing e.g. ReqStart entries, where the first field is the
41 client IP address.
42
43 -g <session|request|vxid|raw>
44 The grouping of the log records. The default is to group by
45 vxid.
46
47 -h Print program usage and exit
48
49 -i <taglist>
50 Include log records of these tags in output. Taglist is a
51 comma-separated list of tag globs. Multiple -i options may be
52 given.
53
54 If a tag include option is the first of any tag selection
55 options, all tags are first marked excluded.
56
57 -I <[taglist:]regex>
58 Include by regex matching. Output only records matching taglist
59 and regular expression. Applies to any tag if taglist is absent.
60 Multiple -I options may be given.
61
62 If a tag include option is the first of any tag selection
63 options, all tags are first marked excluded.
64
65 -L <limit>
66 Sets the upper limit of incomplete transactions kept before the
67 oldest transaction is force completed. A warning record is syn‐
68 thesized when this happens. This setting keeps an upper bound on
69 the memory usage of running queries. Defaults to 1000 transac‐
70 tions.
71
72 -n <dir>
73 Specify the varnishd working directory (also known as instance
74 name) to get logs from. If -n is not specified, the host name is
75 used.
76
77 -p <period>
78 Specified the number of seconds to measure over, the default is
79 60 seconds. The first number in the list is the average number
80 of requests seen over this time period. This option has no
81 effect if -1 option is also used.
82
83 -Q <file>
84 Specifies the file containing the VSL query to use. When multi‐
85 ple -Q or -q options are specified, all queries are considered
86 as if the 'or' operator was used to combine them.
87
88 -q <query>
89 Specifies the VSL query to use. When multiple -q or -Q options
90 are specified, all queries are considered as if the 'or' opera‐
91 tor was used to combine them.
92
93 -r <filename>
94 Read log in binary file format from this file. The file can be
95 created with varnishlog -w filename.
96
97 -t <seconds|off>
98 Timeout before returning error on initial VSM connection. If set
99 the VSM connection is retried every 0.5 seconds for this many
100 seconds. If zero the connection is attempted only once and will
101 fail immediately if unsuccessful. If set to "off", the connec‐
102 tion will not fail, allowing the utility to start and wait inde‐
103 finetely for the Varnish instance to appear. Defaults to 5 sec‐
104 onds.
105
106 -T <seconds>
107 Sets the transaction timeout in seconds. This defines the maxi‐
108 mum number of seconds elapsed between a Begin tag and the End
109 tag. If the timeout expires, a warning record is synthesized and
110 the transaction is force completed. Defaults to 120 seconds.
111
112 -x <taglist>
113 Exclude log records of these tags in output. Taglist is a
114 comma-separated list of tag globs. Multiple -x options may be
115 given.
116
117 -X <[taglist:]regex>
118 Exclude by regex matching. Do not output records matching
119 taglist and regular expression. Applies to any tag if taglist is
120 absent. Multiple -X options may be given.
121
122 -V Print version information and exit.
123
124 --optstring
125 Print the optstring parameter to getopt(3) to help writing wrap‐
126 per scripts.
127
129 The following example displays a continuously updated list of the most
130 frequently requested URLs:
131
132 varnishtop -i ReqURL
133
134 The following example displays a continuously updated list of the most
135 commonly used user agents:
136
137 varnishtop -C -I ReqHeader:User-Agent
138
140 · varnishd(1)
141
142 · varnishhist(1)
143
144 · varnishlog(1)
145
146 · varnishncsa(1)
147
148 · varnishstat(1)
149
151 The varnishtop utility was originally developed by Poul-Henning Kamp in
152 cooperation with Verdens Gang AS and Varnish Software AS, and later
153 substantially rewritten by Dag-Erling Smørgrav. This manual page was
154 written by Dag-Erling Smørgrav, and later updated by Martin Blix Gryde‐
155 land.
156
158 This document is licensed under the same licence as Varnish itself. See
159 LICENCE for details.
160
161 · Copyright (c) 2006 Verdens Gang AS
162
163 · Copyright (c) 2006-2015 Varnish Software AS
164
165
166
167
168 VARNISHTOP(1)