You can use the AliyunPipelineConfig custom resource definition (CRD) or call an API operation to create a Logtail configuration. This topic describes how to use the Logtail configuration generator to automatically generate a CRD and an API parameter script that you can use to create a Logtail configuration in an efficient manner.
Procedure
Log on to the Simple Log Service console.
In the Projects section, click the project that you want to manage.
In the left-side navigation pane, choose
.On the CRD Generator page, select a collection scenario. In the Configuration Details section, configure the parameters for a Logtail configuration. After the parameters are configured, a YAML script for a CRD-based Logtail configuration and JSON settings for the related API operation are displayed in the Preview Configurations section.
Collection scenario: The following scenarios are supported for data collection from servers: Text Logs, Kubernetes - File, Stdout and Stderr - New Version, and Stdout and Stderr - Old Version.
Logtail configuration: You can import an existing Logtail configuration or create a Logtail configuration based on the collection scenario that you select. To import an existing Logtail configuration, click Import Logtail Configuration.
Configuration preview:
YAML
: a YAML script for the AliyunPipelineConfig CRD-based Logtail configuration is generated. For more information, see [Recommended] Use AliyunPipelineConfig to manage a Logtail configuration. You can directly use the script without the need to modify the script.JSON
: JSON settings are generated for the CreateLogtailPipelineConfig operation that you can call to create a Logtail configuration. For more information, see CreateLogtailPipelineConfig. Thekey-value
pairs in the JSON settings correspond to theparameters and parameter values
configured for the CreateLogtailPipelineConfig operation.
If you want to create a Logtail configuration and use Simple Log Service Processing Language (SPL) to parse logs, specify a sample log. For more information, see Use Logtail SPL to parse logs. Make sure that you specify valid values for the Project Name and Logstore Name parameters before you click Preview to view the processing result.
Copy the generated YAML script or JSON settings to create a Logtail configuration based on your actual collection scenario. For more information, see Scenarios.