---
name: cloud-logs-cloud-logs-cli-temp
title: IBM Cloud Logs CLI
description: You can use the IBM&reg; Cloud Logs command-line interface (CLI) to manage your IBM Cloud Logs instance.
last-updated: 2025-10-31
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/cloud-logs?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# IBM Cloud Logs CLI
{: #cloud-logs-cli-temp}

You can use the IBM&reg; Cloud Logs command-line interface (CLI) to manage your IBM Cloud Logs instance.
{: shortdesc}

## Prerequisites
{: #logs-cli-prereq-temp}

* Install the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started&format=markdown).
* Install the IBM Cloud Logs CLI plug-in by running the following command:

   ```text
   ibmcloud plugin install logs
   ```
   {: pre}

   You're notified on the command line when updates to the IBM Cloud CLI and plug-ins are available. Be sure to keep your CLI up to date so that you can use the latest commands. You can view the current version of all installed plug-ins by running `ibmcloud plugin list`.
   {: tip}

* To target the IBM Cloud Logs instance, use one of the following options.

   Option 1: Run the `ibmcloud logs config set` command.

   ```text
   ibmcloud logs config set service-url https://{API_endpoint}
   ```
   {: pre}


   Option 2: Export an environment variable with your IBM Cloud Logs service endpoint URL.

   ```text
   export LOGS_URL=https://{API_endpoint}
   ```
   {: pre}

   Option 3: Set the service endpoint in the command.

   ```text
   ibmcloud logs --service-url https://{API_endpoint}
   ```
   {: pre}

   Replace `{API_endpoint}` with the API endpoint that is specific to your instance. The API endpoint information can be copied from the service details page in the IBM Cloud Logs UI.

## Commands
{: #cl-commands}

The currently supported version of the IBM Cloud Logs CLI is 0.3.0. If any other version is installed, uninstall the plug-in that is installed and install the current IBM Cloud Logs CLI plug-in.
{: important}

Both `ibmcloud cloud-logs` and `ibmcloud logs` can be used to run IBM Cloud Logs CLI commands.
{: tip}

| Command | Description |
|---------|-------------|
| `alert` | Get an alert by ID. |
| `alert-create` | Create an alert. |
| `alert-delete` | Delete an alert. |
| `alert-update` | Update an alert. |
| `alerts` | List alerts. |
{: caption="IBM Cloud Logs alert CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `alert-definition` | Get an alert definition by ID. |
| `alert-definition-create` | Create an alert definition. |
| `alert-definition-delete` | Delete an alert definition by ID. |
| `alert-definition-update` | Update an alert definition by ID. |
| `alert-definitions` | List alert definitions. |
{: caption="IBM Cloud Logs alert definition CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `background-query-cancel`, `bgq-cancel` | Cancel a background query. |
| `background-query-create`, `bgq-create` | Submit a background query to be processed asynchronously. |
| `background-query-data`, `bgq-data` | Data of the background query to search the logs. |
| `background-query-status`, `bgq-status` | Get the status of a background query. |
{: caption="IBM Cloud Logs background query (asynchronous archive query) CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `data-access-rule-create` | Create a data access rule. |
| `data-access-rule-delete` | Delete a data access rule. |
| `data-access-rule-update` | Update a data access rule. |
| `data-access-rules` | Get a service instance's data access rules by ID. |
{: caption="IBM Cloud Logs data access rule CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `data-usage` | Get the daily and detailed data usage. |
| `data-usage-metrics-export-status` | Get the data usage metrics export status. |
| `data-usage-metrics-export-status-update` | Update the data usage metrics export status. |
{: caption="IBM Cloud Logs data usage CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `enrichment-create` | Create an enrichment. |
| `enrichment-delete` | Delete enrichments. |
| `enrichments` | List all enrichments. |
{: caption="IBM Cloud Logs enrichment CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `event-stream-target-create` | Create an IBM Event Streams for IBM Cloud integration. |
| `event-stream-target-delete` | Delete an Event Streams integration by ID. |
| `event-stream-target-update` | Update an Event Streams integration. |
| `event-stream-targets` | List all Event Streams integrations.
{: caption="IBM Cloud Logs Event Streams integration CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `events2metrics`, `e2m` | Gets the events to metrics definitions by ID. |
| `events2metrics-create`, `e2m-create` | Creates the events to metrics definitions. |
| `events2metrics-delete`, `e2m-delete` | Deletes the events to metrics definitions by ID. |
| `events2metrics-list`, `e2m-list` | Lists the events to metrics definitions. |
| `events2metrics-update`, `e2m-update` | Updates the events to metrics definitions. |
{: caption="IBM Cloud Logs events to metrics CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `outgoing-webhook` | Gets an outbound integration by ID. |
| `outgoing-webhook-create` | Create an outbound integration. |
| `outgoing-webhook-delete` | Delete an outbound integration. |
| `outgoing-webhook-update` | Update an outbound integration. |
| `outgoing-webhooks` | List outbound integrations. |
{: caption="IBM Cloud Logs outbound integration CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `policies` | Gets policies. |
| `policy` | Gets a policy by ID. |
| `policy-create` | Creates a new policy. |
| `policy-delete` | Deletes an existing policy. |
| `policy-update` | Updates an existing policy. |
{: caption="IBM Cloud Logs policy CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `query` | Run a query to search the logs. |
{: caption="IBM Cloud Logs query CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `rule-group` | Gets a rule group by groupid. |
| `rule-group-create` | Creates a rule group. |
| `rule-group-delete` | Deletes a rule group by groupid. |
| `rule-group-update` | Updates a rule group by groupid. |
| `rule-groups` | Gets all rule groups. |
{: caption="IBM Cloud Logs rules CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `view` | Gets a view by ID. |
| `view-create` | Creates a new view. |
| `view-delete` | Deletes a view by ID. |
| `view-update` | Replaces an existing view. |
| `views` | Lists all public views. |
{: caption="IBM Cloud Logs view CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `view-folder` | Get a view folder. |
| `view-folder-create` | Create a view folder. |
| `view-folder-delete` | Deletes a view folder by ID. |
| `view-folder-update` | Replaces an existing view folder. |
| `view-folders` | List a view's folders. |
{: caption="IBM Cloud Logs view folder CLI commands" caption-side="bottom"}

| Command | Description |
|---------|-------------|
| `config` | Control the persistent configuration. | 
| `help` | Show help information. |
{: caption="IBM Cloud Logs additional CLI commands" caption-side="bottom"}

For more information about using these commands, log in to the IBM Cloud and run `ibmcloud logs command_name -h`. For example, `ibmcloud logs views -h`.