All Products
Search
Document Center

Simple Log Service:update_logstore

Last Updated:Oct 26, 2023

Updates the basic information about a Logstore.

Usage notes

Before you run this Log Service CLI command, make sure that the following conditions are met:

Command 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>] [--preserve_storage=<value>] [--encrypt_conf=<value>] [--hot_ttl=<value>] [--mode=<value>] [--telemetry_type=<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>] [--profile=<value>]

Command parameters

The following table describes the required parameters of this command and the parameters that are specific to this 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 this parameter to 3650, data is permanently stored.

--shard_count

Integer

No

2

The number of shards.

Important

You cannot change the number of shards by running the update_logstore command. To change the number of shards, you can call the SplitShard and MergeShard operations.

--enable_tracking

Boolean

No

true

Specifies whether to enable the web tracking feature. Valid values:

  • true

  • false

--append_meta

Boolean

No

false

Specifies whether to record public IP addresses. Valid values:

  • true

  • false

--auto_split

Boolean

No

true

Specifies whether to enable automatic sharding. Valid values:

  • true

  • false

--max_split_shard

Integer

No

64

The maximum number of shards into which existing shards can be automatically split. Valid values: 1 to 256. If you set --autoSplit to true, you must specify this parameter.

--encrypt_conf

String

No

None

The data structure of the encryption configuration.

For more information, see EncryptConf.

--telemetry_type

String

No

None

The type of the observable data. Valid values:

  • None (default): logs

  • Metrics: metrics

--hot_ttl

Integer

No

60

The retention period of data in the hot storage tier of the Logstore. Unit: days. Valid values: 7 to 3000.

If the retention period of hot data exceeds the period specified by --hot_ttl, the data is saved in the Infrequent Access (IA) storage tier. For more information, see Enable hot and cold-tiered storage for a Logstore.

--mode

String

No

standard

The type of the Logstore. Log Service provides two types of Logstores: Standard Logstores and Query Logstores. Valid values:

  • standard: Standard Logstore. This type of Logstore supports the log analysis feature and is suitable for scenarios such as real-time monitoring and interactive analysis. You can also use this type of Logstore to build a comprehensive observability system.

  • query: Query Logstore. This type of Logstore supports high-performance queries. The index traffic fee of a Query Logstore is approximately half that of a Standard Logstore. Query Logstores do not support SQL analysis. Query Logstores are suitable for scenarios in which the amount of data is large, the log retention period is long, or log analysis is not required. If logs are stored for weeks or months, the log retention period is considered long.

For more information about the global parameters of this command, see Global parameters.

Command examples

  • Command

    Use the default account to update the information about the logstore-a Logstore.

    aliyunlog log update_logstore --project_name="aliyun-test-project" --logstore_name="logstore-a" --ttl=30 --enable_tracking=true 
  • Output

    If the command is successfully run, no responses are returned. You can run the following command to query the details of the Logstore:

    aliyunlog log get_logstore --project_name="aliyun-test-project" --logstore_name="logstore-a" --format-output=json

References

  • If the response that is returned by Log Service contains error information after you call an API operation, the call fails. You can handle errors based on the error codes that are returned when API calls fail. For more information, see Error codes.
  • Alibaba Cloud OpenAPI Explorer provides debugging capabilities, SDKs, examples, and related documents. You can use OpenAPI Explorer to debug Log Service API operations without the need to manually encapsulate or sign requests. For more information, visit OpenAPI Portal.
  • For more information about the API operation that corresponds to this command, see UpdateLogStore.

  • Log Service provides the sample code that is used to manage Logstores by using Log Service SDK for Java and Log Service SDK for Python. For more information, see Manage Logstores by using Log Service SDK for Java and Use Simple Log Service SDK for Python to manage Logstores.