All Products
Search
Document Center

Simple Log Service:CLI overview

Last Updated:Jun 04, 2026

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

create_project

Creates a project.

delete_project

Deletes a project.

get_project

Queries a specified project.

list_project

Queries all projects.

copy_project

Replicates all LogStores, Logtail configurations, machine groups, and index configurations from a source project to a destination project.

LogStore management

create_logstore

Creates a LogStore.

delete_logstore

Deletes a LogStore.

get_logstore

Queries a specified LogStore.

list_logstore

Queries all LogStores.

update_logstore

Updates a LogStore.

Shard management

list_shards

Obtains shard information.

split_shard

Splits a shard.

merge_shard

Merges shards.

Logtail machine group management

create_machine_group

Creates a machine group.

delete_machine_group

Deletes a machine group.

update_machine_group

Updates a machine group.

get_machine_group

Queries a specified machine group.

list_machine_group

Queries all machine groups.

list_machines

Queries the servers in a specified machine group.

Logtail configuration management

create_logtail_config

Creates a Logtail configuration.

update_logtail_config

Updates a Logtail configuration.

delete_logtail_config

Deletes a Logtail configuration.

get_logtail_config

Queries a specified Logtail configuration.

list_logtail_config

Queries all Logtail configurations.

Machine group and Logtail configuration association

apply_config_to_machine_group

Applies a Logtail configuration to a machine group.

remove_config_to_machine_group

Removes a Logtail configuration from a machine group.

get_machine_group_applied_configs

Queries the Logtail configurations that are applied to a specified machine group.

get_config_applied_machine_groups

Queries the machine groups to which a Logtail configuration is applied.

Index management

create_index

Creates an index for a specified LogStore.

delete_index

Deletes the index of a specified LogStore.

update_index

Updates the index of a specified LogStore.

get_index_config

Queries the index of a specified LogStore.

Cursor management

get_cursor

Queries a cursor based on a specified point in time.

get_cursor_time

Queries the server-side time based on a cursor.

get_previous_cursor_time

Queries the server-side time based on the previous cursor.

get_begin_cursor

Obtains the BEGIN cursor.

get_end_cursor

Queries the END cursor.

Log management

get_logs

Queries logs using a JSON-based query request. Suitable for term queries.

get_log

Queries a specified number of logs.

get_log_all

Queries logs in bulk.

get_histograms

Queries the distribution of logs.

pull_log

Pulls logs.

pull_logs

Pulls logs in bulk.

pull_log_dump

Downloads logs to local files concurrently.

Consumer group management

create_consumer_group

Creates a consumer group in a specified LogStore.

delete_consumer_group

Deletes a specified consumer group.

update_consumer_group

Updates a specified consumer group.

list_consumer_group

Queries all consumer groups in a specified LogStore.

update_check_point

Updates the checkpoint of a shard consumed by a specified consumer group.

get_check_point

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.