Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::SLS::OssExport

Última atualização: Jun 27, 2026

O recurso ALIYUN::SLS::OssExport cria uma tarefa de envio de dados do Object Storage Service (OSS) que transfere dados de um Logstore do Simple Log Service (SLS) para o OSS para armazenamento.

Sintaxe

{
  "Type": "ALIYUN::SLS::OssExport",
  "Properties": {
    "Configuration": Map,
    "DisplayName": String,
    "ExportName": String,
    "ProjectName": String,
    "Description": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Configuration

Map

Sim

Sim

Configurações da tarefa.

Para mais informações, consulte a seção "Propriedades de Configuration" deste tópico.

DisplayName

String

Sim

Sim

Nome de exibição da tarefa.

Nenhuma.

ExportName

String

Sim

Não

Nome da tarefa.

O nome deve ter entre 2 e 64 caracteres e pode conter letras minúsculas, dígitos, traços curtos (‒) e sublinhados (_). Deve começar e terminar com uma letra minúscula ou dígito.

ProjectName

String

Sim

Não

Nome do projeto SLS.

Nenhuma.

Description

String

Não

Sim

Descrição da tarefa.

A descrição pode ter até 256 caracteres.

Sintaxe de Configuration

"Configuration": {
  "ToTime": Integer,
  "Sink": Map,
  "Logstore": String,
  "FromTime": Integer,
  "RoleArn": String
}

Propriedades de Configuration

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Logstore

String

Sim

Sim

Nome do Logstore no projeto.

Nenhuma.

RoleArn

String

Sim

Sim

Alibaba Cloud Resource Name (ARN) da função, usado para controlar permissões de gravação em dados do OSS e permissões de leitura em dados do Logstore.

Exemplo: acs:ram::13234:role/aliyunlogdefaultrole.

Sink

Map

Sim

Sim

Configurações de envio para o OSS.

Nenhuma.

FromTime

Integer

Não

Sim

Hora de início da tarefa.

Nenhuma.

ToTime

Integer

Não

Sim

Hora de término da tarefa.

Nenhuma.

Sintaxe de Sink

"Sink": {
  "BufferInterval": Integer,
  "ContentType": String,
  "ContentDetail": Map,
  "PathFormat": String,
  "Prefix": String,
  "PathFormatType": String,
  "RoleArn": String,
  "BufferSize": Integer,
  "TimeZone": String,
  "Suffix": String,
  "Endpoint": String,
  "DelaySeconds": Integer,
  "Bucket": String,
  "CompressionType": String
}

Propriedades de Sink

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

BufferInterval

Integer

Sim

Sim

Intervalo máximo de envio.

Valores válidos: 300 a 900. Unidade: segundos.

BufferSize

Integer

Sim

Sim

Tamanho máximo dos dados a enviar.

Tamanho máximo de dados de log brutos enviados e armazenados em um objeto do OSS. Unidade: MB. Quando o tamanho dos dados de log atinge esse valor, o sistema cria automaticamente uma tarefa de envio.

Bucket

String

Sim

Sim

Nome do bucket do OSS.

Nenhuma.

ContentType

String

Sim

Sim

Formato de armazenamento para dados enviados ao OSS.

Valores válidos:

  • json

  • parquet

  • csv

  • orc

O formato Parquet oferece maior eficiência de varredura que CSV ou JSON, mas gera custos mais altos. Selecione um formato conforme os requisitos do seu negócio.

RoleArn

String

Sim

Sim

ARN da função, usado para controlar permissões de gravação em dados do OSS e permissões de leitura em dados do Logstore.

Exemplo: acs:ram::13234:role/aliyunlogdefaultrole.

ContentDetail

Map

Não

Sim

Detalhes do conteúdo.

Se você definir ContentType como json, o valor padrão de ContentDetail será {"EnableTag": false}.

CompressionType

String

Não

Sim

Método de compressão dos dados do OSS.

Valores válidos:

  • none

  • snappy

  • gzip

  • zstd

O valor none indica que os dados brutos não são compactados. Os valores snappy, gzip ou zstd especificam o algoritmo de compressão, o que reduz o uso de armazenamento do bucket do OSS. Os métodos de compressão disponíveis variam conforme o formato de armazenamento.

DelaySeconds

Integer

Não

Sim

Latência de envio.

Atraso antes do envio dos dados. Valores válidos: 900 a 63244800. Unidade: segundos.

Este valor não deve exceder o período de retenção dos dados do Logstore. Recomendamos reservar um período de buffer de vários dias. Caso contrário, pode ocorrer perda de dados.

Endpoint

String

Não

Sim

Endpoint do bucket do OSS.

Nenhuma.

PathFormat

String

Não

Sim

Formato de partição usado para gerar subdiretórios.

Os subdiretórios são gerados dinamicamente com base no valor de BufferInterval. O formato de partição padrão é %Y/%m/%d/%H/%M. Exemplo: 2017/01/23/12/00. O formato de partição não pode começar com uma barra (/). Para mais informações sobre integração com mecanismos de computação do E-MapReduce (EMR), como Hive e Impala, consulte "Criar uma tarefa de envio de dados do OSS (nova versão)".

Prefix

String

Não

Sim

Prefixo do nome do objeto do OSS.

Nenhuma.

PathFormatType

String

Não

Sim

Tipo do formato de partição.

  • Defina o valor como time.

Suffix

String

Não

Sim

Sufixo do nome do objeto do OSS.

Nenhuma.

TimeZone

String

Não

Sim

Fuso horário.

Os caminhos de partição variam conforme o fuso horário. Valores válidos: -1200 a +1400. Exemplo: +0800.

Valores de retorno

Fn::GetAtt

  • ProjectName: nome do projeto SLS.

  • ExportName: nome da tarefa.

Exemplos

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Configuration:
        AssociationPropertyMetadata:
          Parameters:
            ToTime:
              Type: Number
              Description:
                en: The end time of the time range.
              Required: false
              Default: 0
            Sink:
              AssociationPropertyMetadata:
                Parameters:
                  BufferInterval:
                    Type: Number
                    Description:
                      en: 'The shipping time. The maximum interval at which data is shipped. Valid values: 300 to 900. Unit: seconds.'
                    Required: true
                    MinValue: 300
                    MaxValue: 900
                  ContentType:
                    Type: String
                    Description:
                      en: The storage format. You can store data in the Parquet format for data analysis. Compared with data stored in the CSV or JSON format, data stored in the Parquet format can be scanned at a higher efficiency.You are charged more fees when you ship data in the Parquet format than in the CSV or JSON format. Select a storage format for data shipping based on your business requirements.
                    AllowedValues:
                      - json
                      - parquet
                      - csv
                      - orc
                    Required: true
                  ContentDetail:
                    Type: Json
                    Description:
                      en: 'The content detail. If ContentType=json, the default value is {"EnableTag": false}.'
                    Required: false
                  PathFormat:
                    Type: String
                    Description:
                      en: 'The partition format is used to generate subdirectories. A subdirectory is dynamically generated based on the shipping time. The default partition format is %Y/%m/%d/%H/%M. Example: 2017/01/23/12/00. Note that the partition format cannot start with a forward slash (/). For more information about how to integrate with the compute engines of E-MapReduce such as Hive and Impala to query and analyze data'
                    Required: false
                    Default: '%Y/%m/%d/%H/%M'
                  Prefix:
                    Type: String
                    Description:
                      en: The prefix of the OSS object name.
                    Required: false
                  PathFormatType:
                    Type: String
                    Description:
                      en: The partition format type. Only support time.
                    AllowedValues:
                      - time
                    Required: false
                    Default: time
                  RoleArn:
                    Type: String
                    Description:
                      en: 'Used to control permissions of writing data to OSS and reading data in Logstores. Example: acs:ram::13234:role/aliyunlogdefaultrole.'
                    Required: true
                  BufferSize:
                    Type: Number
                    Description:
                      en: 'The shipping size. The value of this parameter determines the maximum size of raw log data that is shipped and stored in an object. Unit: MB. If the size of log data that you want to ship reaches the specified value, a shipping job is automatically created.'
                    Required: true
                    MinValue: 5
                    MaxValue: 256
                  TimeZone:
                    Type: String
                    Description:
                      en: The time zone.Partition paths vary based on time zones. The value should be -1200 to +1400. For example, +0800.
                    Required: false
                  Suffix:
                    Type: String
                    Description:
                      en: The suffix of the OSS object name.
                    Required: false
                  Endpoint:
                    Type: String
                    Description:
                      en: The endpoint of the OSS bucket.
                    Required: false
                  DelaySeconds:
                    Type: Number
                    Description:
                      en: |-
                        The shipping latency.The period of time after which data is shipped. Valid values: 900 to 63244800. Unit: seconds.
                        Note: Do not specify a latency that exceeds the data retention period of the Logstore. We recommend that you reserve a buffer period of a few days for the latency. Otherwise, data loss may occur.
                    Required: false
                    MinValue: 900
                    MaxValue: 63244800
                  Bucket:
                    Type: String
                    Description:
                      en: The name of the OSS bucket.
                    Required: true
                  CompressionType:
                    Type: String
                    Description:
                      en: 'The compression method of OSS data.Valid values: none, snappy, gzip, and zstd. The value none indicates that raw data is not compressed. The value snappy, gzip, or zstd indicates that a specified algorithm is used to compress data, which can reduce the storage space usage of OSS buckets. The compression methods vary based on storage formats.'
                    AllowedValues:
                      - none
                      - snappy
                      - gzip
                      - zstd
                    Required: false
              Type: Json
              Description:
                en: The sink name.
              Required: true
            Logstore:
              Type: String
              Description:
                en: The logstore name of the project.
              Required: true
            FromTime:
              Type: Number
              Description:
                en: The start time of the time range.
              Required: false
              Default: 0
            RoleArn:
              Type: String
              Description:
                en: 'Used to control permissions of writing data to OSS and reading data in Logstores. Example: acs:ram::13234:role/aliyunlogdefaultrole.'
              Required: true
        Type: Json
        Description:
          en: The configuration of the export job.
        Required: true
      ProjectName:
        Type: String
        Description:
          en: The project name of SLS.
        Required: true
        AllowedPattern: ^[a-zA-Z0-9_-]+$
        MinLength: 3
        MaxLength: 63
      DisplayName:
        Type: String
        Description:
          en: The display name of the export job. It must be 4 to 100 characters in length.
        Required: true
        MinLength: 4
        MaxLength: 100
      ExportName:
        Type: String
        Description:
          en: The name of the export job. This value should be unique. It must be 2 to 64 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_). It must start and end with a lowercase letter or a digit.
        Required: true
        AllowedPattern: ^[a-zA-Z0-9_-]+$
        MinLength: 2
        MaxLength: 64
    Resources:
      OssExport:
        Type: ALIYUN::SLS::OssExport
        Properties:
          Configuration:
            Ref: Configuration
          ProjectName:
            Ref: ProjectName
          DisplayName:
            Ref: DisplayName
          ExportName:
            Ref: ExportName
    Outputs:
      ProjectName:
        Description: The project name of SLS.
        Value:
          Fn::GetAtt:
            - OssExport
            - ProjectName
      ExportName:
        Description: The name of the export job.
        Value:
          Fn::GetAtt:
            - OssExport
            - ExportName
    
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Configuration": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "ToTime": {
                "Type": "Number",
                "Description": {
                  "en": "The end time of the time range."
                },
                "Required": false,
                "Default": 0
              },
              "Sink": {
                "AssociationPropertyMetadata": {
                  "Parameters": {
                    "BufferInterval": {
                      "Type": "Number",
                      "Description": {
                        "en": "The shipping time. The maximum interval at which data is shipped. Valid values: 300 to 900. Unit: seconds."
                      },
                      "Required": true,
                      "MinValue": 300,
                      "MaxValue": 900
                    },
                    "ContentType": {
                      "Type": "String",
                      "Description": {
                        "en": "The storage format. You can store data in the Parquet format for data analysis. Compared with data stored in the CSV or JSON format, data stored in the Parquet format can be scanned at a higher efficiency.You are charged more fees when you ship data in the Parquet format than in the CSV or JSON format. Select a storage format for data shipping based on your business requirements."
                      },
                      "AllowedValues": [
                        "json",
                        "parquet",
                        "csv",
                        "orc"
                      ],
                      "Required": true
                    },
                    "ContentDetail": {
                      "Type": "Json",
                      "Description": {
                        "en": "The content detail. If ContentType=json, the default value is {\"EnableTag\": false}."
                      },
                      "Required": false
                    },
                    "PathFormat": {
                      "Type": "String",
                      "Description": {
                        "en": "The partition format is used to generate subdirectories. A subdirectory is dynamically generated based on the shipping time. The default partition format is %Y/%m/%d/%H/%M. Example: 2017/01/23/12/00. Note that the partition format cannot start with a forward slash (/). For more information about how to integrate with the compute engines of E-MapReduce such as Hive and Impala to query and analyze data"
                      },
                      "Required": false,
                      "Default": "%Y/%m/%d/%H/%M"
                    },
                    "Prefix": {
                      "Type": "String",
                      "Description": {
                        "en": "The prefix of the OSS object name."
                      },
                      "Required": false
                    },
                    "PathFormatType": {
                      "Type": "String",
                      "Description": {
                        "en": "The partition format type. Only support time."
                      },
                      "AllowedValues": [
                        "time"
                      ],
                      "Required": false,
                      "Default": "time"
                    },
                    "RoleArn": {
                      "Type": "String",
                      "Description": {
                        "en": "Used to control permissions of writing data to OSS and reading data in Logstores. Example: acs:ram::13234:role/aliyunlogdefaultrole."
                      },
                      "Required": true
                    },
                    "BufferSize": {
                      "Type": "Number",
                      "Description": {
                        "en": "The shipping size. The value of this parameter determines the maximum size of raw log data that is shipped and stored in an object. Unit: MB. If the size of log data that you want to ship reaches the specified value, a shipping job is automatically created."
                      },
                      "Required": true,
                      "MinValue": 5,
                      "MaxValue": 256
                    },
                    "TimeZone": {
                      "Type": "String",
                      "Description": {
                        "en": "The time zone.Partition paths vary based on time zones. The value should be -1200 to +1400. For example, +0800."
                      },
                      "Required": false
                    },
                    "Suffix": {
                      "Type": "String",
                      "Description": {
                        "en": "The suffix of the OSS object name."
                      },
                      "Required": false
                    },
                    "Endpoint": {
                      "Type": "String",
                      "Description": {
                        "en": "The endpoint of the OSS bucket."
                      },
                      "Required": false
                    },
                    "DelaySeconds": {
                      "Type": "Number",
                      "Description": {
                        "en": "The shipping latency.The period of time after which data is shipped. Valid values: 900 to 63244800. Unit: seconds.\nNote: Do not specify a latency that exceeds the data retention period of the Logstore. We recommend that you reserve a buffer period of a few days for the latency. Otherwise, data loss may occur."
                      },
                      "Required": false,
                      "MinValue": 900,
                      "MaxValue": 63244800
                    },
                    "Bucket": {
                      "Type": "String",
                      "Description": {
                        "en": "The name of the OSS bucket."
                      },
                      "Required": true
                    },
                    "CompressionType": {
                      "Type": "String",
                      "Description": {
                        "en": "The compression method of OSS data.Valid values: none, snappy, gzip, and zstd. The value none indicates that raw data is not compressed. The value snappy, gzip, or zstd indicates that a specified algorithm is used to compress data, which can reduce the storage space usage of OSS buckets. The compression methods vary based on storage formats."
                      },
                      "AllowedValues": [
                        "none",
                        "snappy",
                        "gzip",
                        "zstd"
                      ],
                      "Required": false
                    }
                  }
                },
                "Type": "Json",
                "Description": {
                  "en": "The sink name."
                },
                "Required": true
              },
              "Logstore": {
                "Type": "String",
                "Description": {
                  "en": "The logstore name of the project."
                },
                "Required": true
              },
              "FromTime": {
                "Type": "Number",
                "Description": {
                  "en": "The start time of the time range."
                },
                "Required": false,
                "Default": 0
              },
              "RoleArn": {
                "Type": "String",
                "Description": {
                  "en": "Used to control permissions of writing data to OSS and reading data in Logstores. Example: acs:ram::13234:role/aliyunlogdefaultrole."
                },
                "Required": true
              }
            }
          },
          "Type": "Json",
          "Description": {
            "en": "The configuration of the export job."
          },
          "Required": true
        },
        "ProjectName": {
          "Type": "String",
          "Description": {
            "en": "The project name of SLS."
          },
          "Required": true,
          "AllowedPattern": "^[a-zA-Z0-9_-]+$",
          "MinLength": 3,
          "MaxLength": 63
        },
        "DisplayName": {
          "Type": "String",
          "Description": {
            "en": "The display name of the export job. It must be 4 to 100 characters in length."
          },
          "Required": true,
          "MinLength": 4,
          "MaxLength": 100
        },
        "ExportName": {
          "Type": "String",
          "Description": {
            "en": "The name of the export job. This value should be unique. It must be 2 to 64 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_). It must start and end with a lowercase letter or a digit."
          },
          "Required": true,
          "AllowedPattern": "^[a-zA-Z0-9_-]+$",
          "MinLength": 2,
          "MaxLength": 64
        }
      },
      "Resources": {
        "OssExport": {
          "Type": "ALIYUN::SLS::OssExport",
          "Properties": {
            "Configuration": {
              "Ref": "Configuration"
            },
            "ProjectName": {
              "Ref": "ProjectName"
            },
            "DisplayName": {
              "Ref": "DisplayName"
            },
            "ExportName": {
              "Ref": "ExportName"
            }
          }
        }
      },
      "Outputs": {
        "ProjectName": {
          "Description": "The project name of SLS.",
          "Value": {
            "Fn::GetAtt": [
              "OssExport",
              "ProjectName"
            ]
          }
        },
        "ExportName": {
          "Description": "The name of the export job.",
          "Value": {
            "Fn::GetAtt": [
              "OssExport",
              "ExportName"
            ]
          }
        }
      }
    }