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


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


The Log Service CLI supports most features of the Log Service API. The following table describes the commonly used commands that are supported by the Log Service CLI.
Category Command 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 Modifies a Logstore.
Shard management list_shards Queries shards.
split_shard Splits shards.
merge_shard Merges shards.
Machine group management create_machine_group Creates a machine group.
delete_machine_group Deletes a machine group.
update_machine_group Modifies 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 Modifies 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.
Mappings between machine groups and Logtail configurations 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 machine groups to which Logtail configurations are applied.
get_config_applied_machine_groups Queries the Logtail configurations that are applied to a specified machine group.
Index management create_index Creates indexes for a specified Logstore.
delete_index Deletes the indexes of a specified Logstore.
update_index Modifies the indexes of a specified Logstore.
get_index_config Queries the indexes of a specified Logstore.
Cursor management get_cursor Queries a cursor based on a specified point in time.
get_cursor_time Queries the server time based on a cursor.
get_previous_cursor_time Queries the server time based on the previous cursor.
get_begin_cursor Queries a start cursor.
get_end_cursor Queries an end cursor.
Log management put_logs Writes logs.
get_logs Queries logs.
get_log_all Queries a large amount of log data.
get_histograms Queries the distribution of logs.
pull_log Pulls logs.
pull_logs Pulls a large amount of log data.
pull_log_dump Downloads a large amount of log data to local files at the same time.
Shipping management create_shipper Creates a log shipping task.
delete_shipper Deletes a log shipping task.
update_shipper Modifies a log shipping task.
list_shipper Queries log shipping tasks.
get_shipper_tasks Queries the status of log shipping tasks.
retry_shipper_tasks Re-runs failed log shipping tasks.
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 Modifies a specified consumer group.
list_consumer_group Queries all consumer groups in a specified Logstore.
update_check_point Modifies the checkpoint of a shard from which a specified consumer group consumes data.
get_check_point Queries the checkpoint of a shard from which a specified consumer group consumes data.

Cloud Shell

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


For more information, see Log Service CLI.