All Products
Document Center

Simple Log Service:Overview of Log Service CLI

Last Updated:Oct 26, 2023

Log Service provides the command-line interface (CLI) to meet the requirements for automated configurations in Log Service.


Log Service CLI provides the following features:
  • Supports most RESTful API operations of Log Service. For example, you can use the CLI to manage projects, Logstores, machine groups, consumer groups, and Logtail configurations.
  • Allows you to manage logs across multiple accounts and regions.
  • Allows you to query and pull logs.
  • Allows you to migrate data from Elasticsearch to Log Service.
  • Supports flexible time configurations.
  • Allows you to replicate logs across regions at a high speed, reindex historical logs, and ship logs to data warehouses.


Log Service CLI supports most features of Log Service API. The following table describes the commonly used commands that are supported by Log Service CLI.
Project managementcreate_projectCreates a project.
delete_projectDeletes a project.
get_projectQueries a specified project.
list_projectQueries all projects.
copy_projectReplicates all Logstores, Logtail configurations, machine groups, and index configurations from a source project to a destination project.
Logstore managementcreate_logstoreCreates a Logstore.
delete_logstoreDeletes a Logstore.
get_logstoreQueries a specified Logstore.
list_logstoreQueries all Logstores.
update_logstoreUpdates a Logstore.
Shard managementlist_shardsQueries shards.
split_shardSplits a shard.
merge_shardMerges shards.
Machine group managementcreate_machine_groupCreates a machine group.
delete_machine_groupDeletes a machine group.
update_machine_groupUpdates a machine group.
get_machine_groupQueries a specified machine group.
list_machine_groupQueries all machine groups.
list_machinesQueries the servers in a specified machine group.
Logtail configuration managementcreate_logtail_configCreates a Logtail configuration.
update_logtail_configUpdates a Logtail configuration.
delete_logtail_configDeletes a Logtail configuration.
get_logtail_configQueries a specified Logtail configuration.
list_logtail_configQueries all Logtail configurations.
Mappings between machine groups and Logtail configurationsapply_config_to_machine_groupApplies a Logtail configuration to a machine group.
remove_config_to_machine_groupRemoves a Logtail configuration from a machine group.
get_machine_group_applied_configsQueries the Logtail configurations that are applied to a specified machine group.
get_config_applied_machine_groupsQueries the machine groups to which a Logtail configuration is applied.
Index managementcreate_indexCreates indexes for a specified Logstore.
delete_indexDeletes indexes from a specified Logstore.
update_indexUpdates the indexes of a Logstore.
get_index_configQueries the indexes of a Logstore.
Cursor managementget_cursorQueries a cursor based on a specified point in time.
get_cursor_timeQueries the server-side time based on a cursor.
get_previous_cursor_timeQueries the server-side time based on the previous cursor of a specified cursor.
get_begin_cursorQueries a start cursor.
get_end_cursorQueries an end cursor.
Log managementget_logsQueries logs. You can configure a query request by using a JSON file. This command is suitable for exact match scenarios.
get_logQueries a specified number of logs.
get_log_allQueries a large number of logs.
get_histogramsQueries the distribution of logs.
pull_logPulls logs.
pull_logsPulls a large number of logs.
pull_log_dumpDownloads a large number of logs to local files in a concurrent manner.
Consumer group managementcreate_consumer_groupCreates a consumer group in a specified Logstore.
delete_consumer_groupDeletes a consumer group.
update_consumer_groupUpdates a specified consumer group.
list_consumer_groupQueries all consumer groups in a specified Logstore.
update_check_pointUpdates the checkpoint of a shard from which a specified consumer group consumes data.
get_check_pointQueries the checkpoints of shards from which a specified consumer group consumes data.

Cloud Shell

Cloud Shell is a web-based CLI tool. Log Service CLI is built in to Cloud Shell. You can access Cloud Shell from a browser and manage the resources of Log Service by using Log Service CLI. For more information, see Use Cloud Shell.


For more information, see Log Service CLI.