Navigation

mongocli ops-manager logs jobs delete

The logs jobs delete command deletes an in-progress or completed log collection job from the specified Ops Manager project. You can also delete a log collection job through the Ops Manager API.

mongocli ops-manager|om logs|log jobs|job delete <id>
[ --output|-o <output-format> ]
[ --projectId <id-of-project> ]
[ --profile|-P <profile-name> ]
Option
Type
Description
Required?
<id>
string

Unique identifier of the log collection job to delete.

You can retrieve a list of log collection jobs for a project with the mongocli logs jobs list command.

yes
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format
  • go-template for custom output using the Go template
  • go-template-file for custom output specified using the Go template file

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 mongocli iam project list command.

no

When you run logs jobs delete, your terminal prompts:

Are you sure you want to delete: <id> (y/N)

In the terminal, you can enter:

  • y to delete the log collection job, or
  • n to abort the command and keep the log collection job (default).

If the command prints an error, see Troubleshooting for recommended solutions.

The following example uses the mongocli ops-manager logs jobs delete command to delete the completed log collection job 5ec1931cac1a6300711ff72e. The command uses the default profile where the project ID and the Programmatic API Keys are stored.

mongocli ops-manager logs jobs delete 5ec1931cac1a6300711ff72e
Are you sure you want to delete: 5ec1931cac1a6300711ff72e (y/N) y

The log collection job 5ec1931cac1a6300711ff72e is deleted from the project.

Give Feedback