Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager logs jobs list

On this page

  • Syntax
  • Options
  • Output
  • Example

The logs jobs list command retrieves all log collection jobs for a specified Ops Manager project. You can also retrieve all log collection jobs through the Ops Manager API.

mongocli ops-manager|om logs|log jobs|job list|ls
[ --verbose ]
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--verbose
string
If true, includes all child jobs in the response.
no
--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 Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile where the project ID and the Programmatic API 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.

no

The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.

The JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.

Field
Description
links
Array includes one or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
results
Array includes one object for each item detailed in the results Embedded Document.
totalCount
Integer count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.

Each result is one log collection job.

Name
Type
Description
id
string
Unique identifier of the log collection request job.
groupId
string
Unique identifier of the project that the log collection request is associated with.
userId
string
Unique identifier of the user executing the request.
creationDate
string
Timestamp in the number of seconds that have elapsed since the UNIX epoch when the log collection request job was created.
expirationDate
string
Timestamp in the number of seconds that have elapsed since the UNIX epoch when the log collection request job expires.
status
string

Status of the log collection request job. One of the following values:

  • SUCCESS

  • FAILURE

  • IN_PROGRESS

  • MARKED_FOR_EXPIRY

  • EXPIRED

resourceType
string

Type of resource for which logs were requested. One of the following values:

  • CLUSTER

  • PROCESS

  • REPLICASET

resourceName
string
Name of the resource for which logs were requested.
rootResourceName
string
If the request is made to a part of a deployment, such as one replica set in a cluster, this is the name of the complete deployment.
rootResourceType
string

If the request is made to a part of a deployment, such as one replica set in a cluster, this is the type of the complete deployment. One of the following values:

  • CLUSTER

  • PROCESS

  • REPLICASET

downloadUrl
string
URL to download the logs from this request.
redacted
boolean
If true, emails, hostnames, IP addresses, and namespaces in the response are replaced with random string values.
logTypes
array

Array of the log type included in this request. Will contain one of the following values:

  • AUTOMATION_AGENT

  • BACKUP_AGENT

  • MONITORING_AGENT

  • MONGODB

  • FTDC

sizeRequestedPerFileBytes
number
Size for each log file in bytes.
uncompressedSizeTotalBytes
number
Total uncompressed size of the log data returned by this request in bytes.
childJobs
array
Array of child jobs associated with this request. Included in the response if the request includes --verbose true.
childJobs[n]
.automationAgentId
number
Unique identifier of this child job.
childJobs[n]
.errorMessage
string
Error message showing why this child job failed. Omitted if the child job is successful.
childJobs[n]
.startDate
date
Timestamp in ISO 8601 date and time format in UTC when this child job started.
childJobs[n]
.finishDate
date
Timestamp in ISO 8601 date and time format in UTC when this child job finished.
childJobs[n]
.hostName
string
Name of the host from whom the child job collects the logs.
childJobs[n]
.logCollectionType
string

The type of log this child job collects. Returns one of the following values:

  • AUTOMATION_AGENT

  • BACKUP_AGENT

  • MONITORING_AGENT

  • MONGODB

  • FTDC

childJobs[n]
.path
string
Path to the process in the deployment for which this child job collects logs.
childJobs[n]
.status
string

Status of this child job. Returns one of the following values:

  • SUCCESS

  • FAILURE

  • IN_PROGRESS

  • MARKED_FOR_EXPIRY

  • EXPIRED

childJobs[n]
.uncompressedDiskSpaceBytes
number
Total uncompressed disk space in bytes used by this child job.

The following example uses the mongocli ops-manager logs jobs list command to retrieve all log collection jobs in a project. It uses the --verbose true flag to include child jobs. The command uses the default profile where the project ID and the Programmatic API Keys are stored.

mongocli ops-manager logs jobs list --verbose true --output json

The previous example produces the following output:

{
"links": [
{
"rel": "self",
"href": "http://om-svc.mongodb.svc.cluster.local:8080/api/ public/v1.0/groups/5ebeb793ac1a6300711e0770/logCollectionJobs? verbose=true\u0026pageNum=1\u0026itemsPerPage=100"
}
],
"results": [
{
"id": "5ec1931cac1a6300711ff72e",
"groupId": "5ebeb793ac1a6300711e0770",
"userId": "5ebeaf71ac1a6300711dfeee",
"creationDate": "2020-05-17T19:40:12Z",
"expirationDate": "2020-06-16T19:40:12Z",
"status": "SUCCESS",
"resourceType": "replicaset",
"resourceName": "repl",
"rootResourceName": "repl",
"rootResourceType": "replicaset",
"downloadUrl": "http://om-svc.mongodb.svc.cluster.local:8080/ api/public/v1.0/groups/5ebeb793ac1a6300711e0770/ logCollectionJobs/5ec1931cac1a6300711ff72e/download",
"redacted": false,
"logTypes": [
"MONITORING_AGENT"
],
"sizeRequestedPerFileBytes": 10000000,
"uncompressedSizeTotalBytes": 526209,
"childJobs": [
{
"automationAgentId": "5ec1931cac1a6300711ff730",
"finishDate": "2020-05-17T19:40:29Z",
"hostName": "repl-0.repl-svc.mongodb.svc.cluster.local",
"logCollectionType": "MONITORING_AGENT",
"path": "repl-0.repl-svc.mongodb.svc.cluster.local/ monitoring_agent",
"startDate": "2020-05-17T19:40:12Z",
"status": "SUCCESS",
"uncompressedDiskSpaceBytes": 526209
}
]
},
{
"id": "5ec19313ac1a6300711ff6fe",
"groupId": "5ebeb793ac1a6300711e0770",
"userId": "5ebeaf71ac1a6300711dfeee",
"creationDate": "2020-05-17T19:40:03Z",
"expirationDate": "2020-06-16T19:40:03Z",
"status": "SUCCESS",
"resourceType": "replicaset",
"resourceName": "repl",
"rootResourceName": "repl",
"rootResourceType": "replicaset",
"downloadUrl": "http://om-svc.mongodb.svc.cluster.local:8080/ api/public/v1.0/groups/5ebeb793ac1a6300711e0770/ logCollectionJobs/5ec19313ac1a6300711ff6fe/download",
"redacted": false,
"logTypes": [
"FTDC"
],
"sizeRequestedPerFileBytes": 10000000,
"uncompressedSizeTotalBytes": 15963118,
"childJobs": [
{
"automationAgentId": "5ec19313ac1a6300711ff700",
"finishDate": "2020-05-17T19:40:30Z",
"hostName": "repl-0.repl-svc.mongodb.svc.cluster. local:27017",
"logCollectionType": "FTDC",
"path": "repl-0.repl-svc.mongodb.svc.cluster.local/27017/ diagnostic.data",
"startDate": "2020-05-17T19:40:03Z",
"status": "SUCCESS",
"uncompressedDiskSpaceBytes": 5364634
},
{
"automationAgentId": "5ec19313ac1a6300711ff702",
"finishDate": "2020-05-17T19:40:32Z",
"hostName": "repl-1.repl-svc.mongodb.svc.cluster. local:27017",
"logCollectionType": "FTDC",
"path": "repl-1.repl-svc.mongodb.svc.cluster.local/27017/ diagnostic.data",
"startDate": "2020-05-17T19:40:03Z",
"status": "SUCCESS",
"uncompressedDiskSpaceBytes": 5333703
},
{
"automationAgentId": "5ec19313ac1a6300711ff704",
"finishDate": "2020-05-17T19:40:30Z",
"hostName": "repl-2.repl-svc.mongodb.svc.cluster. local:27017",
"logCollectionType": "FTDC",
"path": "repl-2.repl-svc.mongodb.svc.cluster.local/27017/ diagnostic.data",
"startDate": "2020-05-17T19:40:03Z",
"status": "SUCCESS",
"uncompressedDiskSpaceBytes": 5264781
}
]
}
],
"totalCount": 2
}

Back

Start a Log Collection Job