Updates the basic information of a Logstore.

Request syntax

aliyunlog log update_logstore --project_name=<value> --logstore_name=<value> [--ttl=<value>] [--enable_tracking=<value>] [--shard_count=<value>] [--append_meta=<value>] [--auto_split=<value>] [--max_split_shard=<value>] [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]

Request parameters

The following table describes the required and specific parameters of the update_logstore command.
Parameter Type Required Example Description
--project_name String Yes aliyun-test-project The name of the project.
--logstore_name String Yes logstore-a The name of the Logstore.
--ttl Integer No 30 The data retention period. Unit: days. Valid values: 1 to 3650. If you set the value to 3650, the data is permanently stored.
--shard_count Integer No None The number of shards.
Notice The number of shards cannot be updated by running the update_logstore command. The number can be increased only by running the SplitShard command or reduced only by running the MergeShards command.
--enable_tracking Boolean No true Specifies whether to enable the WebTracking feature. Valid values:
  • true: enables the WebTracking feature
  • false: disables the WebTracking feature
--append_meta Boolean No None Specifies whether to record public IP addresses. Valid values:
  • true: Public IP addresses are recorded.
  • false: Public IP addresses are not recorded.
--auto_split Boolean No None Specifies whether to enable automatic sharding. Valid values:
  • true: Automatic sharding is enabled.
  • false: Automatic sharding is disabled.
--max_split_shard Integer No None The maximum number of shards for automatic sharding. Valid values: 1 to 64. If the --autoSplit parameter is set to true, you must specify the --max_split_shard parameter.
For information about the global parameters of the Log Service command-line interface (CLI), see Global variables.

Examples

  • Sample requests
    Use the default account to modify the information of a Logstore named logstore-a.
    aliyunlog log update_logstore --project_name="aliyun-test-project" --logstore_name="logstore-a" --ttl=30 --enable_tracking=true 
  • Sample responses

    After you run the command, no responses are returned.

Error codes

If an error message is returned, fix the error based on the error codes of the related API operation. For more information, see Error codes of UpdateLogstore.

API reference

UpdateLogstore