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

Features

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.

Commands

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.
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 Updates a Logstore.
Shard management list_shards Queries shards.
split_shard Splits a shard.
merge_shard Merges shards.
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.
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 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 indexes for a specified Logstore.
delete_index Deletes indexes from a specified Logstore.
update_index Updates the indexes of a Logstore.
get_index_config Queries the indexes of a 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 of a specified 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. You can configure a query request by using a JSON file. This command is suitable for exact match scenarios.
get_log Queries a specified number of logs.
get_log_all Queries a large number of logs.
get_histograms Queries the distribution of logs.
pull_log Pulls logs.
pull_logs Pulls a large number of logs.
pull_log_dump Downloads a large number of logs to local files in a concurrent manner.
Shipping management create_shipper Creates a log shipping task.
delete_shipper Deletes a log shipping task.
update_shipper Updates a log shipping task.
list_shipper Queries log shipping tasks.
get_shipper_tasks Queries the status of a log shipping task.
retry_shipper_tasks Retries a failed log shipping task.
Consumer group management create_consumer_group Creates a consumer group in a specified Logstore.
delete_consumer_group Deletes a 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 from which a specified consumer group consumes data.
get_check_point Queries 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.

References

For more information, see Log Service CLI.