mongocli ops-manager logs jobs download¶
The logs jobs download
command downloads logs collected from a log
collection job on the specified Ops Manager project to a .tar.gz
file.
You can also download logs collected from an Ops Manager
project through the
Ops Manager
API.
You can download logs from both successful and failed log collection jobs. If the job failed, all successful components are downloaded.
Syntax¶
mongocli ops-manager|om logs|log jobs|job download <log-collection-job-id> [ --out <file-destination> ] [ --output|-o <output-format> ] [ --projectId <id-of-project> ] [ --profile|-P <profile-name> ]
Options¶
Option | Type | Description | Required? |
---|---|---|---|
<log-collection-job-id> | string | Unique identifier of the log collection job from which to download logs. You can retrieve a list of log collection jobs for a project
with the | yes |
--out, -o | string | Output filename or path to filename. If omitted, logs are
downloaded to your current directory as <log-name>.tar.gz . | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--profile , -P | string | Name of the profile where the public and private
keys for the project are saved. If omitted, uses the default profile. To learn more about creating a
profile, see Configure the MongoDB CLI. | no |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. Note You can retrieve the list of projects, including their IDs, using
the | no |
Output¶
The command downloads the logs of the specified log collection job to:
- The current directory as a file named
<log-name>.tar.gz
, or - A directory and filename you specify with the
--out
option.
If the command returns an error, see Troubleshooting for recommended solutions.
Example¶
The following example uses the
mongocli ops-manager logs jobs download
command to download the
logs from log collection job 5ec1cac4ac1a63007120b4ef
. The command
uses the default profile where the project ID
and the Programmatic API Key