varnish-cli (7) Linux Manual Page
Varnish CLI – Varnish Command Line Interface
Description
Varnish as 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.
The CLI can be used for the following tasks:
configuration- You can upload, change and delete VCL files from the CLI.
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.
bans- Bans are filters that are applied to keep Varnish from serving stale content. When you issue a ban Varnish will not serve any banned object from cache, but rather re-fetch it from its backend servers.
process management- You can stop and start the cache (child) process though the CLI. You can also retrieve the lastst stack trace if the child process has crashed.
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 pushing the CLI to that service. Please see varnishd(1) for details.
Syntax
Commands are usually terminated with a newline. Long command can be entered using sh style here documents. The format of here-documents is:
<< word here document word
word can be any continuous string choosen to make sure it doesn’t appear naturally in the following here document.
When using the here document style of input there are no restrictions on lenght. When using newline-terminated commands maximum lenght is limited by the varnishd parameter cli_buffer.
When commands are newline terminated they get tokenized before parsing so if you have significant spaces enclose your strings in double quotes. Within the quotes you can escape characters with \. The n, r and t get translated to newlines, carrage returns and tabs. Double quotes themselves can be escaped with a backslash.
To enter characters in octals use the
nn syntax. Hexadecimals can be entered with the
