TLS offers convenient and efficient data import features, supporting multiple data sources such as Elasticsearch. The data import function structures your Elasticsearch data and stores it in TLS for further query, analysis, and multi-platform processing. This topic describes how to import data from Elasticsearch to TLS.
Features overview
Elasticsearch is a distributed, RESTful search and data analytics engine. In migration scenarios such as moving services to the cloud or relocating applications, you can quickly import data from existing ELK systems into TLS. Currently supported data sources include Volcengine Elasticsearch, self-built Elasticsearch clusters, and Elasticsearch clusters from other cloud providers. When importing data from Elasticsearch, you can filter data with queries and configure time fields. After creating an import task, you can view the progress and status in TLS console, or use service log analysis for detailed progress and status data.
In addition, TLS will add the following metadata fields to imported log data:
Notice
- Currently, only historical data import is supported. Data written to Elasticsearch after the import task is successfully created can not be imported into TLS. Once historical data import is complete, the task will automatically end.
- You can only import data into TLS via the public network. If your data source is Volcengine Elasticsearch or a self-managed Elasticsearch cluster on Volcengine ECS, you need to enable public access for the cluster.
- After creating an import task, it is recommended to enable indexing for fields to facilitate preview and query analysis of imported log data.
- If a field key in Elasticsearch starts with an underscore (_), TLS will automatically add the tag prefix to it for subsequent indexing, log query, and analysis.
Limits
Performance description
The service performance of the ElasticSearch data import feature depends on multiple factors. Main factors include:
- Complexity of ES queries: You need to configure ES queries in the import task to filter data. The more complex the ES queries configured in the import task, the longer the ES server takes to process the request, which affects the data reading speed of the current import task.
- Target topic write speed: The number of shards in the target log topic determines the data write speed. The maximum write rate per shard in a log topic is 5 MiB/s. We recommend that you evaluate the required number of shards in the target log topic based on the data volume, such as by enabling the auto split feature or adding shards in time when handling large volumes of data. For more information about shards, see Manage shards.
Billing description
Prerequisites
- An Elasticsearch cluster is created.
- A log project and log topic are created. For detailed steps, see Create resources.
- Before importing data from Alibaba Cloud or Tencent Cloud Elasticsearch, configure an IP address allowlist on the source node to allow the log collection data import task to access data on the source node. For the IP address list, see IP address whitelist.
- Before using the log import or log shipping features for the first time, you must complete cloud resource access authorization to grant TLS permission to access and write resources. If authorization has not yet been granted, TLS will provide guidance when you create a log import task in the console. We recommend using the Volcanoengine primary account for authorization. For more information, see Cross-service access authorization.
Create an ES data import task
Step 1 Configure basic information
- 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, select Elasticsearch.
- Fill in Basic information configuration.
Step 2 Configure data source
- Fill in the data source configuration.
- After confirming the configuration, click Next.
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.
Verify data import results
- In the left navigation pane, select Common functions > Query and analysis
- Select the log project and log topic that stores Elasticsearch data from the list on the left side of the Query and analysis page.
- Preview data on the Query and analysis page.
- About one minute after the data is written, you can preview it on the Query and analysis page in TLS. The latest log data from the past 5 minutes is displayed by default. You can also set other time ranges or query statements. If you successfully preview or query the data imported into the ES cluster, the import is successful.
- You can also view the status of import tasks on the data import task list page. For details, see View import tasks.
View import tasks
View configuration details
- 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's Task List section, click the name of the target import task.
- View task configuration information.
- The details page of the log import task displays basic information and data source configuration.
Task status
The description of import task status:
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.
Delete imported tasks
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.
Troubleshooting and problem diagnosis