The SLS command-line interface (CLI) automates log service configuration across projects, Logstores, and machine groups.
Features
The SLS CLI supports:
-
Manage projects, Logstores, machine groups, consumer groups, and Logtail configurations through most SLS REST API operations.
-
Manage logs across multiple accounts and regions.
-
Query and pull logs.
-
Migrate data from Elasticsearch.
-
Configure flexible time settings.
-
Replicate logs across regions at high speeds, re-index historical data.
Subcommands
The SLS CLI supports most SLS API features. The following table lists commonly used subcommands.
|
Category |
Subcommand |
Description |
|
Project management |
Creates a project. |
|
|
Deletes a project. |
||
|
Queries a specified project. |
||
|
Queries all projects. |
||
|
Replicates all LogStores, Logtail configurations, machine groups, and index configurations from a source project to a destination project. |
||
|
LogStore management |
Creates a LogStore. |
|
|
Deletes a LogStore. |
||
|
Queries a specified LogStore. |
||
|
Queries all LogStores. |
||
|
Updates a LogStore. |
||
|
Shard management |
Obtains shard information. |
|
|
Splits a shard. |
||
|
Merges shards. |
||
|
Logtail machine group management |
Creates a machine group. |
|
|
Deletes a machine group. |
||
|
Updates a machine group. |
||
|
Queries a specified machine group. |
||
|
Queries all machine groups. |
||
|
Queries the servers in a specified machine group. |
||
|
Logtail configuration management |
Creates a Logtail configuration. |
|
|
Updates a Logtail configuration. |
||
|
Deletes a Logtail configuration. |
||
|
Queries a specified Logtail configuration. |
||
|
Queries all Logtail configurations. |
||
|
Machine group and Logtail configuration association |
Applies a Logtail configuration to a machine group. |
|
|
Removes a Logtail configuration from a machine group. |
||
|
Queries the Logtail configurations that are applied to a specified machine group. |
||
|
Queries the machine groups to which a Logtail configuration is applied. |
||
|
Index management |
Creates an index for a specified LogStore. |
|
|
Deletes the index of a specified LogStore. |
||
|
Updates the index of a specified LogStore. |
||
|
Queries the index of a specified LogStore. |
||
|
Cursor management |
Queries a cursor based on a specified point in time. |
|
|
Queries the server-side time based on a cursor. |
||
|
Queries the server-side time based on the previous cursor. |
||
|
Obtains the BEGIN cursor. |
||
|
Queries the END cursor. |
||
|
Log management |
Queries logs using a JSON-based query request. Suitable for term queries. |
|
|
Queries a specified number of logs. |
||
|
Queries logs in bulk. |
||
|
Queries the distribution of logs. |
||
|
Pulls logs. |
||
|
Pulls logs in bulk. |
||
|
Downloads logs to local files concurrently. |
||
|
Consumer group management |
Creates a consumer group in a specified LogStore. |
|
|
Deletes a specified consumer group. |
||
|
Updates a specified consumer group. |
||
|
Queries all consumer groups in a specified LogStore. |
||
|
Updates the checkpoint of a shard consumed by a specified consumer group. |
||
|
Queries the checkpoint of a shard consumed by a specified consumer group. |
Cloud Shell support
Cloud Shell is a browser-based command-line tool with the SLS CLI built in. Manage SLS resources from any browser. For more information, see Use Cloud Shell.
References
For more information, see Simple Log Service CLI.