In Log Service, a Logstore 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

Note You can create up to 200 Logstores for each project.
  1. Log on to the Log Service console.
  2. In the Projects section, click the name of the project that you want to view.
  3. Choose Log Storage > Logstores. On the Logstores tab, click the + icon.
  4. In the Create Logstore panel, set the 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 After 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.
    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.
    Note If you modify the data retention period, the new retention period takes effect after 1 hour. Then, Log Service deletes data based on the new retention period. However, the data volume displayed on the Storage Size(Log) card on the homepage of the Log Service console is updated the next day. For example, if you modify the data retention period from five days to one day, Log Service deletes the logs of the previous four days after 1 hour.
    Shards Log Service provides shards to read and write data. Each shard supports a write speed of 5 MB/s, 500 write operations per second, 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 Shard.
    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.
  5. Click OK.

Modify the configurations of a Logstore

  1. Choose Log Storage > Logstores. On the Logstores tab, find the Logstore that you want to modify, and then choose Modify a Logstore > Modify.
  2. On the Logstore Attributes page, click Modify.
    For more information about the related parameters, see Create a Logstore.
  3. 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 and 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.
  1. Choose Log Storage > Logstores. On the Logstores tab, find the Logstore that you want to delete, and then choose Modify a Logstore > Delete.
    Warning After you delete a Logstore, all log data in the Logstore is deleted and cannot be restored. Proceed with caution.
  2. In the Delete dialog box, click OK.

Logstore-related API operations

Action Operation
Create a Logstore CreateLogstore
Delete a Logstore DeleteLogstore
Query a Logstore
Modify a Logstore UpdateLogstore