If you plan to configure Logtail collection tasks by using an AliyunPipelineConfig CRD or by calling an API, this topic describes how to use the logtail configuration generator. This tool automatically generates the required CRD definitions and API parameter scripts to accelerate the configuration process and reduce manual effort.
Procedure
Log on to the Simple Log Service console.
In the Projects section, click the one you want.

-
In the left-side navigation pane, click .

-
On the CRD Generator page, select a collection scenario at the top and configure the logtail configuration in the left-side section. After you complete the configuration, a YAML script for the AliyunPipelineConfig CRD and a JSON configuration for API calls are generated in the Preview configurations section on the right.
-
Collection scenario: The following collection scenarios are supported: Text logs in a server scenario, Kubernetes - file, and Stdout and stderr - new/old version.
-
Logtail configuration: Click Import logtail configuration to import an existing configuration on the Import logtail configuration page, or create a new logtail configuration based on the selected collection scenario.
-
Preview configurations:
-
YAML: Generates a script to create a logtail configuration by using an AliyunPipelineConfig CRD. This script can be used directly without modification. -
JSON: Provides the configuration for calling the CreateLogtailPipelineConfig API operation. Thekey-valuepairs in the JSON correspond to theparameter-valuepairs for the API call.
-

-
-
If you create a new logtail configuration and use LoongCollector to process logs in SPL mode (as shown in the following figure), you must first provide a sample log. Then, when you click Preview to view the processing result, ensure that you specify the correct Project name and Logstore name.

-
Copy the generated YAML or JSON and create a logtail configuration based on your specific scenario.
> CRD Generator

