Data transformation reads data from a source Logstore, processes the data, and writes the results to one or more destination Logstores. You can then query and analyze the transformed data. This topic describes how to create a data transformation job in the Simple Log Service console.
Prerequisites
-
Data is collected in Simple Log Service. For more information, see data collection.
-
If you are a RAM user, you have the required permissions for data transformation. For more information, see Grant permissions for data transformation to a RAM user.
Procedure
Log on to the Simple Log Service console.
-
Go to the data transformation page.
In the Projects section, click the project you want.
On the tab, click the logstore you want.
-
On the query and analysis page, click Data Transformation.
-
In the upper-right corner, select a time range for the data.
Make sure that logs appear on the Raw Logs tab after you select the time range.
-
In the editor, enter a data transformation statement.
For more information about the statement syntax, see Data transformation syntax.
-
Preview the data.
-
Click Quick.
Simple Log Service supports Quick and Advanced preview modes. For more information, see Preview and debug data.
-
Click Preview Data.
View the preview results.
-
If the data transformation fails due to an incorrect statement or permission errors, follow the instructions on the page to resolve the issue.
-
If the results are correct, proceed to step 6.
-
-
-
Create a data transformation job.
-
Click Save as Transformation Job (Old Version).
-
In the Create Data Transformation Job panel, configure the following parameters and click OK.
Parameter
Description
Job name
The name of the data transformation job.
Display name
The display name of the data transformation job.
Job description
The description of the data transformation job.
Authorization method
The method used to authorize the data transformation job to read data from the source Logstore.
-
Default Role: The job assumes the
AliyunLogETLRolesystem role to read data from the source logstore. -
Custom Role: The job assumes a custom role to read data from the source logstore.
You must first grant the custom role permissions to read data from the source logstore. Then, enter the ARN of the custom role in the Role ARN field. For more information, see Use a custom role to access data.
Storage destination
Destination name
The storage destination name. A storage destination includes configurations such as the project and Logstore.
You can create multiple storage destinations to store transformation results in different Logstores. Note the following:
-
You can use the
nameparameter in thee_output()ore_coutput()function within your transformation statement to define the Destination name. For more information, see e_output. -
If the transformation statement does not include the
e_output()function, the job writes results to the first configured destination Logstore by default.If you have only one destination Logstore, the
e_output()function is typically not needed. -
If you specify the
name,project, andlogstoreparameters in thee_output()ore_coutput()function, those settings override the Destination project and Destination logstore configurations in the UI.
Destination region
The region where the destination project is located.
Cross-region data transformation uses HTTPS to ensure data privacy.
Cross-region data transformation transmits data over the public internet, which may cause job latency due to network instability. Select the DCDN Acceleration checkbox to accelerate cross-region transmission. Before you use this feature, make sure that acceleration is enabled for the corresponding project. For more information, see Accelerate log collection.
NoteCross-region data transformation is billed based on outbound internet traffic (after compression). For more information, see Pay-by-feature.
Destination project
The project where the transformed data is stored.
Destination logstore
The Logstore where the transformation results are stored.
WarningDo not set the destination Logstore to the same as the source Logstore. This misconfiguration causes an infinite data loop and incurs additional storage and traffic costs. You are responsible for any charges resulting from this error.
Authorization method
The method used to authorize the data transformation job to write data to the destination Logstore.
-
Default Role: The job assumes the
AliyunLogETLRolesystem role to write transformation results to the destination Logstore. -
Custom Role: The job assumes a custom role to write transformation results to the destination Logstore.
You must first grant the custom role permissions to write data to the destination Logstore. Then, enter the ARN of the custom role in the Role ARN field. For more information, see Use a custom role to access data.
Processing scope
Time range
The time range for the data transformation job.
NoteThis time range is based on the time when the logs are received by the service.
-
All: Processes all logs from the earliest time point available in the logstore until the job is manually stopped.
-
From Specific Time: Processes logs from a specified start time until the job is manually stopped.
-
Specific Time Range: Processes logs within a specified time range. The job stops automatically at the end of the range.
Advanced options
Advanced parameter configuration
For sensitive information such as database connection passwords used in processing statements, you can save the information as key-value pairs in a secret and reference it in the processing statement by using
res_local("key").Click + to add multiple key-value pairs. For example,
config.vpc.vpc_id.test1:vpc-uf6mskb0b****n9yjcan represent the ID of the VPC where an RDS instance is located. -
-
Next steps
After the data transformation job is created, you can:
-
On the Data Transformation Overview page, view job details, modify the job, or stop the job. For more information, see Manage data transformation jobs.
-
Query and analyze data in the destination Logstore. For more information, see Get started with query and analysis.