1VARNISHLOG(1) VARNISHLOG(1)
2
3
4
6 varnishlog - Display Varnish logs
7
9 varnishlog [-a] [-A] [-b] [-c] [-C] [-d] [-D] [-E] [-g <session|re‐
10 quest|vxid|raw>] [-h] [-i <taglist>] [-I <[taglist:]regex>] [-k <num>]
11 [-L <limit>] [-n <dir>] [-P <file>] [-Q <file>] [-q <query>] [-r <file‐
12 name>] [-R <limit[/duration]>] [-t <seconds|off>] [-T <seconds>] [-u]
13 [-v] [-V] [-w <filename>] [-x <taglist>] [-X <[taglist:]regex>]
14
16 The following options are available:
17
18 -a When writing output to a file with the -w option, append to it
19 rather than overwrite it. This option has no effect without the
20 -w option.
21
22 -A When writing output to a file with the -w option, output data in
23 ascii format. This option has no effect without the -w option.
24
25 -b Only display transactions and log records coming from backend
26 communication.
27
28 -c Only display transactions and log records coming from client
29 communication.
30
31 -C Do all regular expression and string matching caseless.
32
33 -d Process log records at the head of the log and exit.
34
35 -D Daemonize.
36
37 -E Display ESI transactions and other types of sub-requests. This
38 implies the -c option and includes other client transactions.
39
40 -g <session|request|vxid|raw>
41 The grouping of the log records. The default is to group by
42 vxid.
43
44 -h Print program usage and exit
45
46 -i <taglist>
47 Include log records of these tags in output. Taglist is a
48 comma-separated list of tag globs. Multiple -i options may be
49 given.
50
51 If a tag include option is the first of any tag selection op‐
52 tions, all tags are first marked excluded.
53
54 -I <[taglist:]regex>
55 Include by regex matching. Output only records matching taglist
56 and regular expression. Applies to any tag if taglist is absent.
57 Multiple -I options may be given.
58
59 If a tag include option is the first of any tag selection op‐
60 tions, all tags are first marked excluded.
61
62 -k <num>
63 Process this number of matching log transactions before exiting.
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 <file>
78 Write the process' PID to the specified file.
79
80 -Q <file>
81 Specifies the file containing the VSL query to use. When multi‐
82 ple -Q or -q options are specified, all queries are considered
83 as if the 'or' operator was used to combine them.
84
85 -q <query>
86 Specifies the VSL query to use. When multiple -q or -Q options
87 are specified, all queries are considered as if the 'or' opera‐
88 tor was used to combine them.
89
90 -r <filename>
91 Read log in binary file format from this file. The file can be
92 created with varnishlog -w filename. If the filename is -, logs
93 are read from the standard input. and cannot work as a daemon.
94
95 -R <limit[/duration]>
96 Restrict the output to the specified limit. Transactions exceed‐
97 ing the limit will be suppressed. The limit is specified as the
98 maximum number of transactions (with respect to the chosen
99 grouping method) and an optional time period. If no duration is
100 specified, a default of s is used. The duration field can be
101 formatted as in VCL (e.g. -R 10/2m) or as a simple time period
102 without the prefix (e.g. -R 5/m). When in -g raw grouping mode,
103 this setting can not be used alongside -i, -I, -x or -X, and we
104 advise using -q instead.
105
106 -t <seconds|off>
107 Timeout before returning error on initial VSM connection. If set
108 the VSM connection is retried every 0.5 seconds for this many
109 seconds. If zero the connection is attempted only once and will
110 fail immediately if unsuccessful. If set to "off", the connec‐
111 tion will not fail, allowing the utility to start and wait inde‐
112 finetely for the Varnish instance to appear. Defaults to 5 sec‐
113 onds.
114
115 -T <seconds>
116 Sets the transaction timeout in seconds. This defines the maxi‐
117 mum number of seconds elapsed between a Begin tag and the End
118 tag. If the timeout expires, a warning record is synthesized and
119 the transaction is force completed. Defaults to 120 seconds.
120
121 -u When writing output to a file with the -w option, output data is
122 not buffered. This option has no effect without the -w option.
123
124 -v Use verbose output on record set printing, giving the VXID on
125 every log line. Without this option, the VXID will only be given
126 on the header of that transaction.
127
128 -V Print version information and exit.
129
130 -w <filename>
131 Redirect output to file. The file will be overwritten unless the
132 -a option was specified. If the application receives a SIGHUP in
133 daemon mode the file will be reopened allowing the old one to
134 be rotated away. The file can then be read by varnishlog and
135 other tools with the -r option, unless the -A option was speci‐
136 fied. This option is required when running in daemon mode. If
137 the filename is -, varnishlog writes to the standard output and
138 cannot work as a daemon.
139
140 -x <taglist>
141 Exclude log records of these tags in output. Taglist is a
142 comma-separated list of tag globs. Multiple -x options may be
143 given.
144
145 -X <[taglist:]regex>
146 Exclude by regex matching. Do not output records matching
147 taglist and regular expression. Applies to any tag if taglist is
148 absent. Multiple -X options may be given.
149
150 --optstring
151 Print the optstring parameter to getopt(3) to help writing wrap‐
152 per scripts.
153
155 • SIGHUP
156
157 Rotate the log file (see -w option) in daemon mode, abort the loop
158 and die gracefully when running in the foreground.
159
160 • SIGUSR1
161
162 Flush any outstanding transactions
163
165 • varnishd(1)
166
167 • varnishhist(1)
168
169 • varnishncsa(1)
170
171 • varnishstat(1)
172
173 • varnishtop(1)
174
175 • vsl(7)
176
177 • vsl-query(7)
178
180 The varnishlog utility was developed by Poul-Henning Kamp <‐
181 phk@phk.freebsd.dk> in cooperation with Verdens Gang AS and Varnish
182 Software AS. This manual page was initially written by Dag-Erling
183 Smørgrav, and later updated by Per Buer and Martin Blix Grydeland.
184
186 This document is licensed under the same licence as Varnish itself. See
187 LICENCE for details.
188
189 • Copyright (c) 2006 Verdens Gang AS
190
191 • Copyright (c) 2006-2015 Varnish Software AS
192
193
194
195
196 VARNISHLOG(1)