This topic describes the types of Logstores and the operations that you can perform on a Logstore.
Overview
A Logstore in Simple Log Service is used to collect, store, and query logs. Each Logstore belongs to a project. You can create multiple Logstores in a project.
Simple Log Service provides two types of Logstores: Standard Logstores and Query Logstores.
If you set the Billing Mode parameter to Pay-by-ingested-data, you can set the Logstore Type parameter only to 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 use this type of Logstore to build a comprehensive observability system.
Query Logstore: This type of Logstore supports high-performance queries. The index traffic fee of a Query Logstore is lower than that of a Standard Logstore. Query Logstores do not support SQL analysis. Query Logstores are suitable for scenarios in which the volume of data is large, the log retention period is long, or log analysis is not required. Log retention periods of weeks or months are considered long.
For more information, see Logstore.
Logstore comparison by type
If you set the Billing Mode parameter to Pay-by-feature, you can set the Logstore Type parameter to Standard or Query. The following table describes the differences between the two types of Logstores.
Item | Standard Logstore | Query Logstore | |
Fee | USD 0.0875 per GB | USD 0.0146 per GB | |
Feature | Collection of business system logs | Supported | Supported. Logs of cloud services cannot be collected. |
Supported | Supported | ||
Supported | Supported | ||
Log analysis based on SQL statements | Supported | Not supported | |
Supported | Supported | ||
Supported | Supported | ||
Supported | Not supported | ||
Supported | Supported | ||
Supported | Not supported | ||
Supported | Alert rules can be configured based only on search statements. | ||
Supported | Not supported | ||
Supported | Supported | ||
Supported | Supported | ||
Supported | Supported |
Limits
System Logstores and dedicated Logstores for cloud services cannot store irrelevant logs.
For example, internal-operation_log is a system Logstore that can store only the detailed logs of Simple Log Service.
For example, oss-log-store in a specific project is a dedicated Logstore for Object Storage Service (OSS). This Logstore can store only the access logs of OSS.
Create a Logstore
You can create up to 200 Logstores in a project.
Log on to the Log Service console.
In the Projects section, click the project that you want to manage.
On the tab, click the + icon.
In the Create Logstore panel, configure the parameters. The following table describes the parameters.
Parameter
Description
Logstore Type
The type of the Logstore. Simple Log Service provides two types of Logstores: Standard Logstores and Query Logstores. For more information about the differences between the two types of Logstores, see Logstore comparison by type.
You can upgrade a Query Logstore to a Standard Logstore. For more information, see Method 1.
ImportantYou cannot downgrade a Standard Logstore to a Query Logstore.
Billing Mode
The billing mode of the Logstore. Valid values: Pay-by-ingested-data and Pay-by-feature. For more information, see Billable items.
NoteThe first time you use the pay-by-ingested-data billing mode, you must enable the billing mode as prompted.
Logstore Name
The name of the Logstore. The name must be unique in the project to which the Logstore belongs. After the Logstore is created, you cannot change the name of the Logstore.
WebTracking
If you turn on WebTracking, you can collect data from HTML, HTML5, iOS, and Android platforms to Simple Log Service by using the web tracking feature. For more information, see Use the web tracking feature to collect logs.
Permanent Storage
If you select Permanent Storage, Simple Log Service permanently stores the collected logs in the Logstore.
NoteYou can call an API operation to query the data retention period. If the value is 3650, the logs are permanently stored.
Intelligent Tiered Storage
If you turn on Intelligent Tiered Storage, you can store data in the hot storage tier, Infrequent Access (IA) storage tier, or Archive storage tier based on your business requirements.
You can specify a retention period for data that is stored in the hot storage tier and select Automatically Deleted. In this case, data is retained only in the hot data storage tier and expired data is automatically deleted.
You can specify a retention period for data that is stored in the hot storage tier and select Automatically Converted to IA. In this case, data is first stored in the hot storage tier and then automatically moved to the IA storage tier after the specified retention period. If you specify a retention period for data that is stored in the IA storage tier and select Automatically Deleted, data that is stored in the IA storage tier is automatically deleted after the specified retention period.
You can specify a retention period for data that is stored in the hot storage tier and select Automatically Converted to IA. In this case, data is first stored in the hot storage tier and then automatically moved to the IA storage tier after the specified retention period. If you specify a retention period for data that is stored in the IA storage tier and select Automatically Converted to Archive, data is first stored in the IA storage tier and then automatically moved to the Archive storage tier after the specified retention period.
You can specify a retention period for data that is stored in the hot storage tier and select Automatically Converted to Archive. In this case, data is first stored in the hot storage tier and then automatically moved to the Archive storage tier after the specified retention period. If you specify a retention period for data that is stored in the Archive storage tier and select Automatically Deleted, data that is stored in the Archive storage tier is automatically deleted after the specified retention period.
ImportantFor more information about the hot storage tier, IA storage tier, and Archive storage tier, see Overview of tiered storage.
Data in the hot storage tier must be stored for at least 7 days before it can be moved to the IA storage tier and at least 30 days before it can be moved to the Archive storage tier. Data in the IA storage tier must be stored for at least 30 days before it can be moved to the Archive storage tier. For more information, see Lifecycle management for data storage.
For more information about the billing of data in the hot storage tier, IA storage tier, and Archive storage tier, see Billable items.
Data Retention Period
The retention period of logs in the Logstore. Valid values: 1 to 3000. Unit: days.
WarningLogs are automatically deleted after the specified retention period ends.
If you do not select Permanent Storage, you must specify a value for the Data Retention Period parameter.
ImportantIf you shorten the data retention period, Simple Log Service deletes all expired data within 1 hour. The data volume that is displayed for Storage Size(Log) on the homepage of the Simple Log Service console is updated on the next day. For example, if you change the value of the Data Retention Period parameter from 5 to 1, Simple Log Service deletes the data of the previous four days within 1 hour.
Shards
The number of shards. Log Simple Service provides shards to read and write data. Each shard supports a write capacity of 5 MB/s and 500 writes/s and a read capacity of 10 MB/s and 100 reads/s. You can create up to 10 shards in each Logstore. You can create up to 200 shards in each project. For more information, see Shard.
By default, two shards are created when you create a Logstore. For more information about the billing of shards, see Why am I charged for active shards?
Automatic Sharding
If you turn on Automatic Sharding, Simple Log Service increases the number of shards when the existing shards cannot accommodate the data that is written. For more information, see Manage shards.
Maximum Shards
If you turn on Automatic Sharding, you must configure this parameter to specify the maximum number of readwrite shards that can be created. Maximum value: 256.
Log Public IP
If you turn on Log Public IP, Simple Log Service adds the following information to the Tag field of the collected logs:
__client_ip__: the public IP address of the log source.
__receive_time__: the time when Simple Log Service receives the log. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 UTC, Thursday, January 1, 1970.
Click OK.
Modify the configurations of a Logstore
On the tab, move the pointer over the Logstore whose configurations you want to modify and choose .
On the Logstore Attributes page, click Modify.
For more information about the parameters, see Create a Logstore.
ImportantYou can change the billing mode of a Logstore from pay-by-ingested-data to pay-by-feature. You cannot change the billing mode of a Logstore from pay-by-feature to pay-by-ingested-data.
Click Save.
Upgrade the specifications of a Logstore
You can upgrade a Query Logstore to a Standard Logstore. You can upgrade the specifications of a Logstore on the Logstore Attributes page. You can also follow the on-screen instructions to upgrade the specifications of a Logstore when you perform analysis operations.
After the upgrade, Enable Analytics is automatically turned on for the current fields. You can analyze only the logs that are written to Simple Log Service after the log analysis feature is enabled. You can turn on Enable Analytics to enable the feature.
If you enable the log analysis feature, fees are not generated for the index traffic of historical data.
After the upgrade, you are charged for the index traffic of new logs that are written to Simple Log Service. The index traffic fee is calculated based on the index traffic of log data billable item. For more information, see Billable items of pay-by-feature.
Method 1
On the
tab, move the pointer over the Logstore whose specifications you want to upgrade and choose .On the Logstore Attributes page, click Modify.
Find Logstore Type and click Upgrade.
In the message that appears, click Confirm.
Click Save.
Method 2
When you configure an index for a Logstore, click the switch in the Enable Analytics column. Then, you are prompted to upgrade the specifications of the Logstore. You can click Upgrade Now to complete the upgrade. For more information about how to configure indexes, see Create indexes.
Method 3
On the Quick Analysis tab of a Logstore, click the field that you want to manage. Then, you are prompted to upgrade the specifications of the Logstore. You can click Upgrade Now to complete the upgrade. For more information about the quick analysis feature, see Quick analysis.
Delete a Logstore
Before you can delete a Logstore, you must delete all Logtail configurations that are associated with the Logstore. For more information, see Delete Logtail configurations.
If the log shipping feature is enabled for the Logstore, we recommend that you stop writing data to the Logstore and make sure that all data in the Logstore is shipped before you delete the Logstore.
If you delete all Logstores, you are still charged for data storage on the day that you delete the Logstores, but no charges are incurred from the following day. As a result, from the third day after you delete all Logstores, you no longer receive a Simple Log Service bill.
On the tab, move the pointer over the Logstore that you want to delete and choose .
WarningAfter you delete a Logstore, all logs in the Logstore are deleted and cannot be restored. Proceed with caution.
In the Delete message, click OK.
Delete logs
Logs are automatically deleted after the specified retention period ends. To delete logs, you can modify Data Retention Period.
If you shorten the data retention period, Simple Log Service deletes all expired data within 1 hour. The data volume that is displayed for Storage Size(Log) on the homepage of the Simple Log Service console is updated on the next day. For example, if you change the value of the Data Retention Period parameter from 5 to 1, Simple Log Service deletes the data of the previous four days within 1 hour.
Enable the intelligent tiered storage feature
You can enable the intelligent tiered storage feature for a Logstore on the Logstore Attributes page. For more information, see Enable intelligent tiered storage.
Logstore-related API operations
Action | API operation |
Create a Logstore | |
Delete a Logstore | |
Query a Logstore |
|
Modify a Logstore |