All Products
Search
Document Center

Simple Log Service:Logtail configuration generator

Last Updated:Mar 31, 2025

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

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the project that you want to manage.

    image

  3. In the left-side navigation pane, choose image > CRD Generator.

    image

  4. 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. The key-value pairs in the JSON settings correspond to the parameters and parameter values configured for the CreateLogtailPipelineConfig operation.

    image

  5. 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.

    image

  6. Copy the generated YAML script or JSON settings to create a Logtail configuration based on your actual collection scenario. For more information, see Scenarios.

Scenarios

Text Logs

If you want to use a Logtail configuration to collect text logs from a server, you cannot use a CRD to create the Logtail configuration. The following example describes how to call an API operation based on the Logtail configuration generator to create a Logtail configuration.

  1. Generate parameter settings required for calling an API operation to create a Logtail configuration: In the Configuration Details section, create a Logtail configuration or import an existing Logtail configuration. For more information, see Logtail configuration.

    image

  2. Call an API operation: The JSON settings in the Preview Configurations section correspond to the parameters that you must configure for the CreateLogtailPipelineConfig operation to create a Logtail configuration. For more information, see Debugging.

Kubernetes - File

  1. On the CRD Generator page, click Kubernetes - File.

    image

  2. In the Configuration Details section, click Import Logtail Configuration to import an existing Logtail configuration or create a Logtail configuration by following the instructions provided in the following topics:

    • You can install Logtail in DaemonSet mode and create a Logtail configuration to collect text logs from a Container Service for Kubernetes (ACK) cluster. For more information, see Simple Log Service Console.

    • You can install Logtail in DaemonSet mode and create a Logtail configuration to collect text logs from a self-managed Kubernetes cluster. For more information, see Simple Log Service console.

  3. Create a Logtail configuration.

    Use the AliyunPipelineConfig CRD

    In the Preview Configurations section, a YAML script for a CRD-based Logtail configuration is displayed. Create a Logtail configuration based on the actual scenario by following the instructions provided in the following topics:

    Call an API operation

    The JSON settings in the Preview Configurations section correspond to the parameters that you must configure for the CreateLogtailPipelineConfig operation to create a Logtail configuration. For more information, see Debugging.

Stdout and Stderr - New Version and Stdout and Stderr - Old Version

  1. On the CRD Generator page, click Stdout and Stderr - New Version or Stdout and Stderr - Old Version.

    image

  2. In the Configuration Details section, click Import Logtail Configuration to import an existing Logtail configuration or create a Logtail configuration by following the instructions provided in the following topics:

    • You can install Logtail in DaemonSet mode and create a Logtail configuration to collect stdout and stderr (old version) from an ACK cluster. For more information, see Simple Log Service console.

    • You can install Logtail in DaemonSet mode and create a Logtail configuration to collect stdout and stderr (old version) from a self-managed Kubernetes cluster. For more information, see Simple Log Service console.

  3. Create a Logtail configuration.

    Use the AliyunPipelineConfig CRD

    In the Preview Configurations section, a YAML script for a CRD-based Logtail configuration is displayed. Create a Logtail configuration based on the actual scenario by following the instructions provided in the following topics:

    • You can install Logtail in DaemonSet mode and create a Logtail configuration to collect stdout and stderr (old version) from an ACK cluster. For more information, see CRD - AliyunPipelineConfig (Recommended).

    • You can install Logtail in DaemonSet mode and create a Logtail configuration to collect stdout and stderr (old version) from a self-managed Kubernetes cluster. For more information, see

      CRD - AliyunPipelineConfig (Recommended).

    Call an API operation

    The JSON settings in the Preview Configurations section correspond to the parameters that you must configure for the CreateLogtailPipelineConfig operation to create a Logtail configuration. For more information, see Debugging.