.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "VARNISH-CLI" 7 "" "" .SH NAME varnish-cli \- Varnish Command Line Interface .\" Copyright (c) 2011-2021 Varnish Software AS .\" SPDX-License-Identifier: BSD-2-Clause .\" See LICENSE file for full text of license . .SH DESCRIPTION .sp Varnish has a command line interface (CLI) which can control and change most of the operational parameters and the configuration of Varnish, without interrupting the running service. .sp The CLI can be used for the following tasks: .INDENT 0.0 .TP .B configuration You can upload, change and delete VCL files from the CLI. .TP .B parameters You can inspect and change the various parameters Varnish has available through the CLI. The individual parameters are documented in the varnishd(1) man page. .TP .B bans Bans are filters that are applied to keep Varnish from serving stale content. When you issue a ban Varnish will not serve any \fIbanned\fP object from cache, but rather re\-fetch it from its backend servers. .TP .B process management You can stop and start the cache (child) process though the CLI. You can also retrieve the latest stack trace if the child process has crashed. .UNINDENT .sp If you invoke varnishd(1) with \-T, \-M or \-d the CLI will be available. In debug mode (\-d) the CLI will be in the foreground, with \-T you can connect to it with varnishadm or telnet and with \-M varnishd will connect back to a listening service \fIpushing\fP the CLI to that service. Please see \fIvarnishd(1)\fP for details. .SS Syntax .sp The Varnish CLI is similar to another command line interface, the Bourne Shell. Commands are usually terminated with a newline, and they may take arguments. The command and its arguments are \fItokenized\fP before parsing, and as such arguments containing spaces must be enclosed in double quotes. .sp It means that command parsing of .INDENT 0.0 .INDENT 3.5 .sp .EX help banner .EE .UNINDENT .UNINDENT .sp is equivalent to .INDENT 0.0 .INDENT 3.5 .sp .EX \(dqhelp\(dq banner .EE .UNINDENT .UNINDENT .sp because the double quotes only indicate the boundaries of the \fBhelp\fP token. .sp Within double quotes you can escape characters with \e (backslash). The \en, \er, and \et get translated to newlines, carriage returns, an tabs. Double quotes and backslashes themselves can be escaped with \e\(dq and \e\e respectively. .sp To enter characters in octals use the \ennn syntax. Hexadecimals can be entered with the \exnn syntax. .sp Commands may not end with a newline when a shell\-style \fIhere document\fP (here\-document or heredoc) is used. The format of a here document is: .INDENT 0.0 .INDENT 3.5 .sp .EX << word here document word .EE .UNINDENT .UNINDENT .sp \fIword\fP can be any continuous string chosen to make sure it doesn\(aqt appear naturally in the following \fIhere document\fP\&. Traditionally EOF or END is used. .SS Quoting pitfalls .sp Integrating with the Varnish CLI can be sometimes surprising when quoting is involved. For instance in Bourne Shell the delimiter used with here documents may or may not be separated by spaces from the \fB<<\fP token: .INDENT 0.0 .INDENT 3.5 .sp .EX cat <\(aq Line 1 Pos 1) < .INDENT 0.0 .INDENT 3.5 Authenticate. .UNINDENT .UNINDENT .SS backend.list [\-j] [\-p] [] .INDENT 0.0 .INDENT 3.5 List backends. .sp \fB\-p\fP also shows probe status. .sp \fB\-j\fP specifies JSON output. .sp Unless \fB\-j\fP is specified for JSON output, the output format is five columns of dynamic width, separated by white space with the fields: .INDENT 0.0 .IP \(bu 2 Backend name .IP \(bu 2 Admin: How health state is determined: .INDENT 2.0 .IP \(bu 2 \fBhealthy\fP: Set \fBhealthy\fP through \fBbackend.set_health\fP\&. .IP \(bu 2 \fBsick\fP: Set \fBsick\fP through \fBbackend.set_health\fP\&. .IP \(bu 2 \fBprobe\fP: Health state determined by a probe or some other dynamic mechanism. .IP \(bu 2 \fBdeleted\fP: Backend has been deleted, but not yet cleaned up. .UNINDENT .sp Admin has precedence over Health .IP \(bu 2 Probe \fBX/Y\fP: \fIX\fP out of \fIY\fP checks have succeeded .sp \fIX\fP and \fIY\fP are backend specific and may represent probe checks, other backends or any other metric. .sp If there is no probe or the director does not provide details on probe check results, \fB0/0\fP is output. .IP \(bu 2 Health: Probe health state .INDENT 2.0 .IP \(bu 2 \fBhealthy\fP .IP \(bu 2 \fBsick\fP .UNINDENT .sp If there is no probe, \fBhealthy\fP is output. .IP \(bu 2 Last change: Timestamp when the health state last changed. .UNINDENT .sp The health state reported here is generic. A backend\(aqs health may also depend on the context it is being used in (e.g. the object\(aqs hash), so the actual health state as visible from VCL (e.g. using \fBstd.healthy()\fP) may differ. .sp For \fB\-j\fP, the object members should be self explanatory, matching the fields described above. \fBprobe_message\fP has the format \fB[X, Y, \(dqstate\(dq]\fP as described above for Probe. JSON Probe details (\fB\-j \-p\fP arguments) are director specific. .UNINDENT .UNINDENT .SS backend.set_health [auto|healthy|sick] .INDENT 0.0 .INDENT 3.5 Set health status of backend(s) matching . .INDENT 0.0 .IP \(bu 2 With \fBauto\fP, the health status is determined by a probe or some other dynamic mechanism, if any .IP \(bu 2 \fBhealthy\fP sets the backend as usable .IP \(bu 2 \fBsick\fP sets the backend as unsable .UNINDENT .UNINDENT .UNINDENT .SS ban [&& ...] .INDENT 0.0 .INDENT 3.5 Mark obsolete all objects where all the conditions match. .sp See \fIvcl(7)_ban\fP for details .UNINDENT .UNINDENT .SS ban.list [\-j] .INDENT 0.0 .INDENT 3.5 List the active bans. .sp Unless \fB\-j\fP is specified for JSON output, the output format is: .INDENT 0.0 .IP \(bu 2 Time the ban was issued. .IP \(bu 2 Objects referencing this ban. .IP \(bu 2 \fBC\fP if ban is completed = no further testing against it. .IP \(bu 2 if \fBlurker\fP debugging is enabled: .INDENT 2.0 .IP \(bu 2 \fBR\fP for req.* tests .IP \(bu 2 \fBO\fP for obj.* tests .IP \(bu 2 Pointer to ban object .UNINDENT .IP \(bu 2 Ban specification .UNINDENT .sp Durations of ban specifications get normalized, for example \(dq7d\(dq gets changed into \(dq1w\(dq. .UNINDENT .UNINDENT .SS banner .INDENT 0.0 .INDENT 3.5 Print welcome banner. .UNINDENT .UNINDENT .SS help [\-j|] .INDENT 0.0 .INDENT 3.5 Show command/protocol help. .sp \fB\-j\fP specifies JSON output. .UNINDENT .UNINDENT .SS panic.clear [\-z] .INDENT 0.0 .INDENT 3.5 Clear the last panic, if any, \-z will clear related varnishstat counter(s) .UNINDENT .UNINDENT .SS panic.show [\-j] .INDENT 0.0 .INDENT 3.5 Return the last panic, if any. .sp \fB\-j\fP specifies JSON output \-\- the panic message is returned as an unstructured JSON string. .UNINDENT .UNINDENT .SS param.reset .INDENT 0.0 .INDENT 3.5 Reset parameter to default value. .UNINDENT .UNINDENT .SS param.set [\-j] .INDENT 0.0 .INDENT 3.5 Set parameter value. .sp The JSON output is the same as \fBparam.show \-j \fP and contains the updated value as it would be represented by a subsequent execution of \fBparam.show\fP\&. .sp This can be useful to later verify that a parameter value didn\(aqt change and to use the value from the JSON output to reset the parameter to the desired value. .UNINDENT .UNINDENT .SS param.show [\-l|\-j] [|changed] .INDENT 0.0 .INDENT 3.5 Show parameters and their values. .sp The long form with \fB\-l\fP shows additional information, including documentation and minimum, maximum and default values, if defined for the parameter. JSON output is specified with \fB\-j\fP, in which the information for the long form is included; only one of \fB\-l\fP or \fB\-j\fP is permitted. If a parameter is specified with \fB\fP, show only that parameter. If \fBchanged\fP is specified, show only those parameters whose values differ from their defaults. .UNINDENT .UNINDENT .SS pid [\-j] .INDENT 0.0 .INDENT 3.5 Show the pid of the master process, and the worker if it\(aqs running. .sp \fB\-j\fP specifies JSON output. .UNINDENT .UNINDENT .SS ping [\-j] [] .INDENT 0.0 .INDENT 3.5 Keep connection alive. .sp The response is formatted as JSON if \fB\-j\fP is specified. .UNINDENT .UNINDENT .SS quit .INDENT 0.0 .INDENT 3.5 Close connection. .UNINDENT .UNINDENT .SS start .INDENT 0.0 .INDENT 3.5 Start the Varnish cache process. .UNINDENT .UNINDENT .SS status [\-j] .INDENT 0.0 .INDENT 3.5 Check status of Varnish cache process. .sp \fB\-j\fP specifies JSON output. .UNINDENT .UNINDENT .SS stop .INDENT 0.0 .INDENT 3.5 Stop the Varnish cache process. .UNINDENT .UNINDENT .SS storage.list [\-j] .INDENT 0.0 .INDENT 3.5 List storage devices. .sp \fB\-j\fP specifies JSON output. .UNINDENT .UNINDENT .SS vcl.deps [\-j] .INDENT 0.0 .INDENT 3.5 List all loaded configuration and their dependencies. .sp Unless \fB\-j\fP is specified for JSON output, the output format is up to two columns of dynamic width separated by white space with the fields: .INDENT 0.0 .IP \(bu 2 VCL: a VCL program .IP \(bu 2 Dependency: another VCL program it depends on .UNINDENT .sp Only direct dependencies are listed, and VCLs with multiple dependencies are listed multiple times. .UNINDENT .UNINDENT .SS vcl.discard ... .INDENT 0.0 .INDENT 3.5 Unload the named configurations (when possible). .sp Unload the named configurations and labels matching at least one name pattern. All matching configurations and labels are discarded in the correct order with respect to potential dependencies. If one configuration or label could not be discarded because one of its dependencies would remain, nothing is discarded. Each individual name pattern must match at least one named configuration or label. .UNINDENT .UNINDENT .SS vcl.inline [auto|cold|warm] .INDENT 0.0 .INDENT 3.5 Compile and load the VCL data under the name provided. .sp Multi\-line VCL can be input using the here document \fIref_syntax\fP\&. .UNINDENT .UNINDENT .SS vcl.label