/usr/bin/varnishncsa: invalid option -- '-'
Usage: /usr/bin/varnishncsa <options>
Options:
[-0] Check configuration
[-a] Append to file
[-b] Backend mode
[-c] Client mode
[-C] Caseless regular expressions
[-d] Process old log entries and exit
[-D] Daemonize
[-E] Show ESI requests
[-F <format>] Set output format
[-f <formatfile>] Read output format from file
[-g <request|vxid>] Grouping mode (default: vxid)
[-h] Usage help
[-j] Make output JSON-compatible
[-k <num>] Limit transactions
[-L <limit>] Incomplete transaction limit
[-n <workdir>] varnish working directory
[-P <file>] PID file
[-Q <file>] VSL query file
[-q <query>] VSL query
[-r <filename>] Binary file input
[-R <limit[/duration]>] Output rate limit
[-t <seconds|off>] VSM connection timeout
[-V] Version
[-w <filename>] Output filename
Options (12)
| Option | Description | Source |
|---|
-0 | Return immediately (i.e. process 0 transactions) if the configuration is valid. | man |
-a | When writing output to a file, append to it rather than overwrite it. | man |
-b | Log backend requests. | man |
-c | Log client requests. | man |
-C | Do all regular expression and string matching caseless. | man |
-d | Process log records at the head of the log and exit. | man |
-D | Daemonize. | man |
-E | Show ESI requests, implies client mode. | man |
-h | Print program usage and exit | man |
-j | Make format-specifier replacements JSON-compatible. | man |
-V | Print version information and exit. | man |
--optstring | Print the optstring parameter to getopt(3) to help writing wrapper scripts. | man |
Examples (3) from the manual page, untested
varnishncsa -F "%{VSL:Begin[2]}x"
Log the second field of the Begin record, corresponding to the VXID of the parent transaction:varnishncsa -F "%{VSL:Timestamp:Process}x"
Log the entire Timestamp record associated with the processing length:varnishncsa -j -F '{"size": %b, "time": "%t", "ua": "%{User-Agent}i"}'
Log in JSON, using the -j flag to ensure that the output is valid JSON for all inputs:
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.