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: |
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
JSON
format{ "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.