SplunkLogDriverProps Struct
Specifies the splunk log driver configuration options.
| Source | aws-ecs/lib/log-drivers/splunk-log-driver.ts |
|---|---|
| Type last changed |
Example
declare const secret: ecs.Secret;
// Create a Task Definition for the container to start
const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
taskDefinition.addContainer('TheContainer', {
image: ecs.ContainerImage.fromRegistry('example-image'),
memoryLimitMiB: 256,
logging: ecs.LogDrivers.splunk({
secretToken: secret,
url: 'my-splunk-url',
}),
});
# secret: ecs.Secret
# Create a Task Definition for the container to start
task_definition = ecs.Ec2TaskDefinition(self, "TaskDef")
task_definition.add_container("TheContainer",
image=ecs.ContainerImage.from_registry("example-image"),
memory_limit_mi_b=256,
logging=ecs.LogDrivers.splunk(
secret_token=secret,
url="my-splunk-url"
)
)
Secret secret;
// Create a Task Definition for the container to start
Ec2TaskDefinition taskDefinition = new Ec2TaskDefinition(this, "TaskDef");
taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("example-image"))
.memoryLimitMiB(256)
.logging(LogDrivers.splunk(SplunkLogDriverProps.builder()
.secretToken(secret)
.url("my-splunk-url")
.build()))
.build());
// Install: dotnet add package Amazon.CDK.Lib
Secret secret;
// Create a Task Definition for the container to start
var taskDefinition = new Ec2TaskDefinition(this, "TaskDef");
taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("example-image"),
MemoryLimitMiB = 256,
Logging = LogDrivers.Splunk(new SplunkLogDriverProps {
SecretToken = secret,
Url = "my-splunk-url"
})
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var secret Secret
// Create a Task Definition for the container to start
taskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String("TaskDef"))
taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{
Image: ecs.ContainerImage_FromRegistry(jsii.String("example-image")),
MemoryLimitMiB: jsii.Number(256),
Logging: ecs.LogDrivers_Splunk(&SplunkLogDriverProps{
SecretToken: secret,
Url: jsii.String("my-splunk-url"),
}),
})
Properties
caNameoptionalstringca_nameoptionalstrcaNameoptionalStringCaNameoptionalstringCaNameoptional*string #Default: The hostname of the splunk-url
caPathoptionalstringca_pathoptionalstrcaPathoptionalStringCaPathoptionalstringCaPathoptional*string #Default: caPath not set.
envoptionalstring[]envoptionaltyping.List[str]envoptionalList<String>Envoptionalstring[]Envoptional*[]*string #Default: No env
If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.
envRegexoptionalstringenv_regexoptionalstrenvRegexoptionalStringEnvRegexoptionalstringEnvRegexoptional*string #Default: No envRegex
Its value is a regular expression to match logging-related environment variables. It is used for advanced log tag options.
formatoptionalSplunkLogFormatformatoptionalSplunkLogFormatformatoptionalSplunkLogFormatFormatoptionalSplunkLogFormatFormatoptionalSplunkLogFormat = inline #Can be inline, json or raw.
gzipLeveloptionalnumbergzip_leveloptionalint | floatgzipLeveloptionalNumberGzipLeveloptionaldoubleGzipLeveloptional*float64 #Default: -1 (Default Compression)
Valid values are -1 (default), 0 (no compression), 1 (best speed) ... 9 (best compression).
Default: index not set.
insecureSkipVerifyoptionalstringinsecure_skip_verifyoptionalstrinsecureSkipVerifyoptionalStringInsecureSkipVerifyoptionalstringInsecureSkipVerifyoptional*string #Default: insecureSkipVerify not set.
labelsoptionalstring[]labelsoptionaltyping.List[str]labelsoptionalList<String>Labelsoptionalstring[]Labelsoptional*[]*string #Default: No labels
If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.
The splunk-token is added to the SecretOptions property of the Log Driver Configuration. So the secret value will not be resolved or viewable as plain text.
sourceoptionalstringsourceoptionalstrsourceoptionalStringSourceoptionalstringSourceoptional*string #Default: source not set.
sourceTypeoptionalstringsource_typeoptionalstrsourceTypeoptionalStringSourceTypeoptionalstringSourceTypeoptional*string #Default: sourceType not set.
Default: The first 12 characters of the container ID
Refer to the log tag option documentation for customizing the log tag format.
verifyConnectionoptionalbooleanverify_connectionoptionalboolverifyConnectionoptionalBooleanVerifyConnectionoptionalboolVerifyConnectionoptional*bool = true #