ALIYUN::SLS::LogtailConfig is used to configure Logtail properties for data collection.

Syntax

{
  "Type": "ALIYUN::SLS::LogtailConfig",
  "Properties": {
    "ProjectName": String,
    "LogtailConfigName": String,
    "LogstoreName": String,
    "RawConfigData": Map,
    "CloneFrom": Map
  }
}

Properties

Property Type Required Editable Description Constraint
ProjectName String Yes No The name of the project. None.
LogtailConfigName String Yes No The name of the Logtail configuration. The name must be unique in a project.

The name must be 2 to 128 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_). The name must start and end with a lowercase letter or digit.

LogstoreName String Yes No The name of the Logstore. None.
RawConfigData Map No Yes The raw configuration data. The format is the same as the format of the response from the GetConfig operation of Log Service.

If you specify the CloneFrom and RawConfigData properties at the same time, the values of both properties are merged in ALIYUN::SLS::LogtailConfig. In this case, the values of configName, outputType, and outputDetail of the RawConfigData property are ignored.

Example: {"configName": "test-logtail-config", "createTime": 1574843554, "inputDetail": {"acceptNoEnoughKeys": false, "adjustTimezone": false, "advanced": { "force_multiconfig": false }, "autoExtend": true, "delayAlarmBytes": 0, "delaySkipBytes": 0, "discardNonUtf8": false, "discardUnmatch": false, "dockerExcludeEnv": {}, "dockerExcludeLabel": {}, "dockerFile": false, "dockerIncludeEnv": {}, "dockerIncludeLabel": {}, "enableRawLog": false, "enableTag": false, "fileEncoding": "utf8", "filePattern": "test.log*", "filterKey": [], "filterRegex": [], "key": [ "time", "logger", "level", "request_id", "user_id", "region_id", "content" ], "localStorage": true, "logPath": "/var/log/test", "logTimezone": "", "logType": "delimiter_log", "maxDepth": 100, "maxSendRate": -1, "mergeType": "topic", "preserve": true, "preserveDepth": 1, "priority": 0, "quote": "\u0001", "sendRateExpire": 0, "sensitive_keys": [], "separator": ",,,", "shardHashKey": [], "tailExisted": false, "timeFormat": "", "timeKey": "", "topicFormat": "none" }, "inputType": "file", "lastModifyTime": 1574843554, "logSample": "2019-11-27 10:48:23,160,,,MAIN,,,INFO,,,98DCC51D-BE5D-49C7-B3FD-37B2BAEFB296,,,123456789,,,cn-hangzhou,,,this is a simple test.", "outputDetail": { "endpoint": "cn-hangzhou-intranet.log.aliyuncs.com", "logstoreName": "test-logstore", "region": "cn-hangzhou"}, "outputType": "LogService"}.

CloneFrom Map No Yes The Logtail configuration of a project that you clone. You must specify the CloneFrom or RawConfigData property.

For more information, see CloneFrom properties.

CloneFrom syntax

"CloneFrom": {
  "ProjectName": String,
  "LogtailConfigName": String
}

CloneFrom properties

Property Type Required Editable Description Constraint
ProjectName String Yes Yes The name of the project. None
LogtailConfigName String Yes Yes The name of the Logtail configuration. None

Return values

Fn::GetAtt

  • Endpoint: the endpoint of Log Service.
  • AppliedMachineGroups: the machine groups to which the Logtail configuration is applied.
  • LogtailConfigName: the name of the Logtail configuration.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Description: Test SLS Logstore
    Parameters: {}
    Resources:
      SlsLogStore:
        Type: ALIYUN::SLS::Logstore
        Properties:
          LogstoreName: Demo
          PreserveStorage: true
          ProjectName: Test
          AppendMeta: true
          MaxSplitShard: 64
          AutoSplit: true
          EnableTracking: false
          ShardCount: 2
    Outputs: {}
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "Test SLS Logstore",
      "Parameters": {
      },
      "Resources": {
        "SlsLogStore": {
          "Type": "ALIYUN::SLS::Logstore",
          "Properties": {
            "LogstoreName": "Demo",
            "PreserveStorage": true,
            "ProjectName": "Test",
            "AppendMeta": true,
            "MaxSplitShard": 64,
            "AutoSplit": true,
            "EnableTracking": false,
            "ShardCount": 2
          }
        }
      },
      "Outputs": {
      }
    }

To view more examples, visit SLS.json and SLS.yml. In the examples, the following resource types are used: ALIYUN::SLS::Project, ALIYUN::SLS::Logstore, ALIYUN::SLS::Index, ALIYUN::SLS::LogtailConfig, ALIYUN::SLS::MachineGroup, ALIYUN::SLS::ApplyConfigToMachineGroup, ALIYUN::ApiGateway::LogConfig, ALIYUN::SLS::Savedsearch, and ALIYUN::SLS::Alert.