The download command allows you to connect to a remote host, collect a particular type of log file from it, and open it for analysis:
If you do not know the types of logs that your remote system supports, the download command can give you some guidance. Omitting the
--type argument causes the system to return an error message that lists the allowable types:
The download command supports
--type=all as a way to load all known log types for the specified host:
The count command gives you the count of the number of log entries that are visible with the current filter applied (if there is one). There is an additional
--nofilter command line option that will give you the unfiltered count if you wish to get that without removing the filter. In the example that follows, the number that shows below the command is the answer returned by the system.
The print command, used to print log entries, is flexible in terms of the format of the reporting (
txt,
xml,
json), as well as the number of entries it prints and the starting entry. You must specify at least the project and resource within the project as arguments to the command. Other arguments, such as formatting, are optional.
The filter command supports two kinds of filters: defining a simple filter dynamically with the
--pattern option (a
regex pattern), or applying a known named filter. In the following example, a simple filter is applied, the count of filtered entries is retrieved, and the entries are printed in XML format:
The print command is used to export entries. This can be done many different ways depending on your needs. Several examples are given.
The normal print command directs its output to
stdout. You can redirect this to a file. This particular example also demonstrates the use of the
--count and
--format options:
The print command also has an
--outfile option for directly specifying the output file. This option has the advantage of being able to display a percentage complete status in the console as the download of the entries progresses. This may be of interest in the case of very large log files. The following example downloads a large number of log entries. (The
--count=all option was used to specify all log entries.)
As an alternative to filtering, you can also use the find command to search for particular patterns. The
find command by default returns the log entry number of the matching entries:
Both the find and
count commands support a couple of additional options that can be useful for use cases such as automated regression testing:
In the following example, Failure is used in a particular log file in the case of any error, and there are 17 instances of
Failure that are known issues and always emitted in the log. As a part of an automated regression test, this log file could be checked and would fail if the count is more than 17 (failing in this case means that the
vmwb-lbcli process returns an exit code of non-zero in addition to printing an error message to
stderr).
The bundle command allows printing of information on the contents of a log bundle, as well as loading all or a subset of the contained log file types in the bundle.
You can load log types from a bundle by adding one or more --load options to the
bundle command. The
load options specify the log types you wish to load. The command requires that you must specify a project name that you wish to load the given log types into. The following is an example of loading a couple of log types:
You can also specify --load=all to load all types in the bundle: