ALIYUN::SLS::LogtailConfig类型用于配置采集数据时的Logtail参数。
语法
{
  "Type": "ALIYUN::SLS::LogtailConfig",
  "Properties": {
    "ProjectName": String,
    "LogtailConfigName": String,
    "LogstoreName": String,
    "RawConfigData": Map,
    "CloneFrom": Map
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| ProjectName | String | 是 | 否 | 日志项目名称。 | 无 | 
| LogtailConfigName | String | 是 | 否 | Logtail配置名称。 | 同一项目下配置名称必须唯一。 长度为2~128个字符。必须以小写英文字母或者数字开头和结尾。可包含小写英文字母、数字、短划线(-)和下划线(_)。 | 
| LogstoreName | String | 是 | 否 | 日志库名称。 | 无 | 
| RawConfigData | Map | 否 | 是 | 原始配置数据。 | 格式与SLS API GetConfig的响应相同。 如果同时指定CloneFrom和RawConfigData,LogtailConfig的数据将会和RawConfigData合并,RawConfigData中的configName、outputType和outputDetail会被忽略。 取值示例: | 
| CloneFrom | Map | 否 | 是 | 克隆其他日志项目的LogtailConfig。 | CloneFrom和RawConfigData必须指定其中一个参数。 更多信息,请参见CloneFrom属性。 | 
CloneFrom语法
"CloneFrom": {
  "ProjectName": String,
  "LogtailConfigName": String
}CloneFrom属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| ProjectName | String | 是 | 是 | 日志项目名称。 | 无 | 
| LogtailConfigName | String | 是 | 是 | Logtail配置名称。 | 无 | 
返回值
Fn::GetAtt
- Endpoint:Endpoint地址。 
- AppliedMachineGroups:日志采集配置的机器列表。 
- LogtailConfigName:Logtail配置名称。 
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  SlsProject:
    Type: ALIYUN::SLS::Project
    Properties:
      Name:
        Fn::Sub: project-test-${ALIYUN::StackId}
  SlsLogtailConfig:
    Type: ALIYUN::SLS::LogtailConfig
    Properties:
      ProjectName:
        Ref: SlsProject
      LogtailConfigName: app01
      LogstoreName:
        Fn::GetAtt:
          - SlsLogStore
          - LogstoreName
      RawConfigData:
        configName: logtail-test
        outputDetail:
          compressType: ''
          logstoreName:
            Fn::GetAtt:
              - SlsLogStore
              - LogstoreName
        outputType: LogService
        logSample: ''
        inputDetail:
          sensitive_keys: []
          shardHashKey: []
          enableRawLog: false
          logType: common_reg_log
          filterRegex: []
          mergeType: topic
          dockerExcludeEnv: {}
          regex: (.*)
          sendRateExpire: 0
          discardNonUtf8: false
          maxSendRate: -1
          priority: 0
          preserveDepth: 1
          localStorage: true
          logTimezone: ''
          dockerIncludeEnv: {}
          preserve: true
          delayAlarmBytes: 0
          discardUnmatch: false
          logPath: /apsara/nuwa
          dockerExcludeLabel: {}
          topicFormat: none
          maxDepth: 10
          key:
            - content
          filePattern: '*.Log'
          timeFormat: ''
          dockerFile: true
          advanced:
            force_multiconfig: false
            k8s:
              ExternalEnvTag: {}
            collect_containers_flag: false
            tail_size_kb: 1024
          dockerIncludeLabel: {}
          delaySkipBytes: 0
          filterKey: []
          tailExisted: false
          adjustTimezone: false
          logBeginRegex: .*
          fileEncoding: utf8
          enableTag: false
        inputType: file
  SlsLogStore:
    Type: ALIYUN::SLS::Logstore
    Properties:
      ProjectName:
        Ref: SlsProject
      AutoSplit: true
      MaxSplitShard: 64
      LogstoreName: mytest
      AppendMeta: true
      ShardCount: 2
      EnableTracking: false
      PreserveStorage: true
Outputs: {}
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "SlsProject": {
      "Type": "ALIYUN::SLS::Project",
      "Properties": {
        "Name": {
          "Fn::Sub": "project-test-${ALIYUN::StackId}"
        }
      }
    },
    "SlsLogStore": {
      "Type": "ALIYUN::SLS::Logstore",
      "Properties": {
        "LogstoreName": "mytest",
        "PreserveStorage": true,
        "ProjectName": {
          "Ref": "SlsProject"
        },
        "AppendMeta": true,
        "MaxSplitShard": 64,
        "AutoSplit": true,
        "EnableTracking": false,
        "ShardCount": 2
      }
    },
    "SlsLogtailConfig": {
      "Type": "ALIYUN::SLS::LogtailConfig",
      "Properties": {
        "ProjectName": {
          "Ref": "SlsProject"
        },
        "LogtailConfigName": "app01",
        "LogstoreName": {
          "Fn::GetAtt": [
            "SlsLogStore",
            "LogstoreName"
          ]
        },
        "RawConfigData": {
          "configName": "logtail-test",
          "inputDetail": {
            "adjustTimezone": false,
            "advanced": {
              "collect_containers_flag": false,
              "force_multiconfig": false,
              "k8s": {
                "ExternalEnvTag": {}
              },
              "tail_size_kb": 1024
            },
            "delayAlarmBytes": 0,
            "delaySkipBytes": 0,
            "discardNonUtf8": false,
            "discardUnmatch": false,
            "dockerExcludeEnv": {},
            "dockerExcludeLabel": {},
            "dockerFile": true,
            "dockerIncludeEnv": {},
            "dockerIncludeLabel": {},
            "enableRawLog": false,
            "enableTag": false,
            "fileEncoding": "utf8",
            "filePattern": "*.Log",
            "filterKey": [],
            "filterRegex": [],
            "key": [
              "content"
            ],
            "localStorage": true,
            "logBeginRegex": ".*",
            "logPath": "/apsara/nuwa",
            "logTimezone": "",
            "logType": "common_reg_log",
            "maxDepth": 10,
            "maxSendRate": -1,
            "mergeType": "topic",
            "preserve": true,
            "preserveDepth": 1,
            "priority": 0,
            "regex": "(.*)",
            "sendRateExpire": 0,
            "sensitive_keys": [],
            "shardHashKey": [],
            "tailExisted": false,
            "timeFormat": "",
            "topicFormat": "none"
          },
          "inputType": "file",
          "logSample": "",
          "outputDetail": {
            "compressType": "",
            "logstoreName": {
              "Fn::GetAtt": [
                "SlsLogStore",
                "LogstoreName"
              ]
            }
          },
          "outputType": "LogService"
        }
      }
    }
  },
  "Outputs": {
  }
}