A Logstore in Log Service is the unit that is used to collect, store, and query data. This topic describes how to create, modify, and delete a Logstore in the Log Service console.
Create a Logstore
- Log on to the Log Service console.
- In the Projects section, click the project in which you want to query and analyze logs.
- Choose + icon. . On the Logstores tab, click the
- In the Create Logstore panel, set the required parameters. The following table describes the parameters.
Parameter Description 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 modify the name. WebTracking If you turn on the WebTracking switch, you can collect data from HTML, HTML5, iOS, or Android platforms and send the data to Log Service by using web tracking. Permanent Storage If you turn on the Permanent Storage switch, Log Service permanently stores the collected logs.Note If you set the data retention period to 3650 by calling the related API operation, the data is permanently stored. Data Retention Period The retention period of the logs in the Logstore. Valid values: 1 to 3000. Unit: days. Logs are automatically deleted after the specified data retention period expires.If you do not turn on the Permanent Storage switch, you must set the Data Retention Period parameter.Note If you shorten the data retention period, the new retention period takes effect 1 hour later. Log Service deletes expired data based on the new setting. However, the data volume displayed on the Storage Size(Log) card on the homepage of the Log Service console will be updated the next day. For example, if you modify the data retention period from five days to one day, Log Service will delete the logs of the previous four days 1 hour later. Shards Log Service provides shards to read and write data. Each shard supports a write speed of 5 MB/s and 500 write operations per second and a read speed of 10 MB/s and 100 read operations per second. You can create up to 10 shards for each Logstore. You can create up to 200 shards for each project. For more information, see Shards. Automatic Sharding If you turn on the Automatic Sharding switch, and the read or write speed does not meet your requirements, Log Service increases the number of shards. For more information, see Manage shards. Maximum Shards If you turn on the Automatic Sharding switch, you must set the Maximum Shards parameter. The maximum number of shards is 64. Log Public IP If you turn on the Log Public IP switch, 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 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
- Choose . On the Logstores tab, find the Logstore that you want to modify, and then choose .
- On the Logstore Attributes page, click Modify. For more information about the related parameters, see Create a Logstore.
- Click Save.
Delete a Logstore
- Before you delete a Logstore, you must delete all related Logtail configuration files.
- If the log shipping feature is enabled for the Logstore, we recommend that you stop writing data to the Logstore before you delete the Logstore. In addition, make sure that all data in the Logstore is shipped.
- If you are not authorized to delete a Logstore by using your Alibaba Cloud account, submit a ticket to delete the Logstore.
- Choose . On the Logstores tab, find the Logstore that you want to delete, and then choose
. Warning After you delete a Logstore, all log data in the Logstore is deleted and cannot be restored. Proceed with caution.
- In the Delete dialog box, click OK.
Logstore-related API operations
|Create a Logstore||CreateLogstore|
|Delete a Logstore||DeleteLogstore|
|Query a Logstore|
|Modify a Logstore||UpdateLogstore|