LogTailConfig

class LogTailConfig : KotlinCustomResource

The Logtail access service is a log collection agent provided by Log Service. You can use Logtail to collect logs from servers such as Alibaba Cloud Elastic Compute Service (ECS) instances in real time in the Log Service console. Refer to details(https://www.alibabacloud.com/help/doc-detail/29058.htm

  • )

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.LogTailConfig;
import com.pulumi.alicloud.log.LogTailConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new RandomInteger("default", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var exampleProject = new Project("exampleProject", ProjectArgs.builder()
.description("terraform-example")
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.project(exampleProject.name())
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleLogTailConfig = new LogTailConfig("exampleLogTailConfig", LogTailConfigArgs.builder()
.project(exampleProject.name())
.logstore(exampleStore.name())
.inputType("file")
.outputType("LogService")
.inputDetail("""
{
"logPath": "/logPath",
"filePattern": "access.log",
"logType": "json_log",
"topicFormat": "default",
"discardUnmatch": false,
"enableRawLog": true,
"fileEncoding": "gbk",
"maxDepth": 10
}
""")
.build());
}
}

Module Support

You can use the existing sls-logtail module to create logtail config, machine group, install logtail on ECS instances and join instances into machine group one-click.

Import

Logtial config can be imported using the id, e.g.

$ pulumi import alicloud:log/logTailConfig:LogTailConfig example tf-log:tf-log-store:tf-log-config

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val inputDetail: Output<String>

The logtail configure the required JSON files. (Refer to details)

Link copied to clipboard
val inputType: Output<String>

The input type. Currently only two types of files and plugin are supported.

Link copied to clipboard
val logSample: Output<String>?

(Optional)The log sample of the Logtail configuration. The log size cannot exceed 1,000 bytes.

Link copied to clipboard
val logstore: Output<String>

The log store name to the query index belongs.

Link copied to clipboard
val name: Output<String>

The Logtail configuration name, which is unique in the same project.

Link copied to clipboard
val outputType: Output<String>

The output type. Currently, only LogService is supported.

Link copied to clipboard
val project: Output<String>

The project name to the log store belongs.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>