After updating the index configurations, the new settings only apply to newly written data. If you need to reset the index rules for historical data within a specified period, refer to this documentation to rebuild the index.
After updating the index, queries and analyses of historical data still follow the previous index rules. The new settings only apply to newly written data. TLS supports the rebuild index feature, which rebuilds the index rules for historical data within a specified time range based on the current latest index configuration. For example, you can set indexes for historical data that previously had no index to expand the range of data available for query and analysis; or add specified fields to the Key-value index so that both historical and new data can be queried by this field.
When rebuilding the index, TLS creates a rebuild index task to record the configuration, progress, and other information related to the action. If you delete the index task, the new indexed data within the corresponding time range will be deleted simultaneously, and this part of historical data will follow the previous index rules.
The rebuild index feature does not incur any functional usage charges, but it may generate resource-related fees, such as:
- Index traffic fee: Rebuilding the index will reconstruct the index for raw logs within the specified time range; this action results in a one-time index traffic fee.
- Newly generated index data after rebuilding will be charged corresponding index storage fees.
- If indexing is enabled for historical data, the index data remains after index reconstruction, and fees are based on storage volume.
- After deleting the index task, TLS will simultaneously delete the rebuilt index data, and this data will no longer generate storage fees.
- Indexing has been enabled for the specified log topic. For detailed instructions, see Configure index.
- Assess the log range for index reconstruction appropriately. The time required for the reindexing task depends on the log data volume—the more data, the longer it takes. During reindexing, log data can not be queried or analyzed. Evaluate the log time range for reindexing to reduce processing time, minimize costs, and limit the impact on query and analysis operations.
- Select the region where log service is located from the top navigation bar.
- In the left navigation pane, select Common functions > Query and analysis.
- On Query and analysis page and in the list of left pane, select the specified project and topic.
- On the query and analysis page for the specified log topic, expand the Index configuration button, and then click Rebuild index.
- Click Add rebuild index task.
- Set up the task details.
- View task status: On the query and analysis page, click Rebuild index to check the status of all rebuild index tasks. Tasks that are in Rebuilding and Canceled states will show their rebuild progress.
- Cancel a rebuilding index task: Locate the target task in the rebuild index task list, and click Cancel. Any indexes already rebuilt before cancellation are retained. Canceled tasks can not be recovered, and unfinished indexes can not be rebuilt. To facilitate further query and analysis, we recommend that you delete the task after cancellation and create a new one.
- Delete the reindexing task: Deleting the task will also delete the newly created index, and this action can not be undone.