IBM Cloud Logs CLI
You can use the IBM® Cloud Logs command-line interface (CLI) to manage your IBM Cloud Logs instance.
Prerequisites
-
Install the IBM Cloud CLI.
-
Install the IBM Cloud Logs CLI plug-in by running the following command:
ibmcloud plugin install logsYou'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. -
To target the IBM Cloud Logs instance, use one of the following options.
Option 1: Run the
ibmcloud logs config setcommand.ibmcloud logs config set service-url https://{API_endpoint}Option 2: Export an environment variable with your IBM Cloud Logs service endpoint URL.
export LOGS_URL=https://{API_endpoint}Option 3: Set the service endpoint in the command.
ibmcloud logs --service-url https://{API_endpoint}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
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.
Both ibmcloud cloud-logs and ibmcloud logs can be used to run IBM Cloud Logs CLI commands.
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |
| Command | Description |
|---|---|
enrichment-create |
Create an enrichment. |
enrichment-delete |
Delete enrichments. |
enrichments |
List all enrichments. |
| 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. |
| 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. |
| 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. |
| 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. |
| Command | Description |
|---|---|
query |
Run a query to search the logs. |
| 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. |
| 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. |
| 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. |
| Command | Description |
|---|---|
config |
Control the persistent configuration. |
help |
Show help information. |
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.