TLS supports Kafka data import. This topic describes the steps to import data from Kafka to TLS.
The data import feature of TLS allows you to import messages from Kafka clusters into a specified log topic. The Kafka data import feature is typically used for scenarios such as cloud migration. For example, you can import various system logs and application data aggregated by a self-built ELK system into TLS for centralized storage, query, analysis, and processing. The data import feature of TLS supports importing data from both Volcanoengine Message Queue Kafka clusters and self-managed Kafka clusters. After you create an import task, you can view details of the task in the TLS console or service logs.
TLS also adds the following metadata fields to imported log data.
The following limitations apply to importing data from Kafka:
- A Kafka cluster that meets the version requirements has been created. For version requirements, see Notice.
- A log project and log topic are created. For detailed steps, see Create resources.
Step 1 Initial configuration
- Select the region where log service is located from the top navigation bar.
- On the left navigation bar, select Common functions > Log Collection.
- In the Data import section, click Kafka Import.
- Select the project and log topic, and then click Next step: configure import rules.
Step 2 Import configuration
- Enter the import configuration.
- If you set the log extraction mode to single-line complete regular expression, you also need to configure the following parameters. You can choose different extraction modes to manually or automatically generate regular expressions. Confirm the extraction results in the extract results section to ensure the regular expression extracts the desired data from your log sample.
- Click Execution preview to view the content in the file to be imported, and then click Next step: check index configuration.
- After completing the import configuration, TLS provides a data preview feature for the specified data source. You can check whether the data in the preview section matches the data to be imported. If the data is different, it means the data source configuration is incorrect. We recommend reconfiguring it.
Step 3 Check index configuration
- Check index configuration.
- Follow the prompts on the page to set or update the index as needed. You can also click Import existing index configuration to import indexes from other log topics.
- If this log topic does not have an index configured, you can set one. For details, see Configure indexes.
- If the index for this log topic is already configured, you can decide whether to update the index based on the log fields parsed by the collection rule.
Notice
- You must enable the index to query and analyze the collected log data.
- The updated index settings only apply to new data written afterward. For more instructions and limitations on query and analysis, see Query overview and Analysis overview.
- Click Next step: check index configuration.
View import task details
After successfully creating a Kafka data import task, you can view relevant information in the TLS console, including details of the import configuration.
- Select the region where log service is located from the top navigation bar.
- On the left navigation bar, select Common functions > Log Collection.
- Then in the Data import tab under Task list, click the log import task name.
- View task configuration information.
- The details page of the log import task displays basic information and data source configuration.
After successfully creating a Kafka data import task, you can modify the task configuration at any time based on your business needs.
- Select the region where log service is located from the top navigation bar.
- On the left navigation bar, select Common functions > Log Collection.
- Then in the Data import tab's Task List section, click the import task to edit.
- In the upper right corner of the page, click Edit configuration.
- You can refer to the instructions in Create import task to modify related configurations.
TLS supports copying data import tasks. If a similar data import task exists, you can copy all the configurations from an existing task, and then adjust the settings as needed to create a new data import task.
- Select the region where log service is located from the top navigation bar.
- On the left navigation bar, select Common functions > Log Collection.
- In the Data import tab under the Task list section, click Copy under the Actions column for the task to be copied.
- Refer to the steps for creating an import task to confirm or modify the relevant parameter settings.
If there is a failure or anomaly with a data import task, you can delete the task and re-import data. If you have finished migrating historical log data, or no longer need to import logs to TLS, you can follow the steps below to delete log import tasks.
Notice
- Deleting a log import task does not affect logs that have already been imported successfully.
- A deleted log import task can not be restored. Proceed with caution.
- Select the region where torch log service is located from the top navigation bar.
- On the left navigation bar, select Common functions > Log Collection.
- In the task list section under data import tab, locate the log import task you need to delete, and click Delete in its Actions column.
- Confirm the information for the task to be deleted in the popup dialog, and then click Confirm.