Skip to content
v2.278.0

SplunkLogDriverProps Struct ​

Specifies the splunk log driver configuration options.

Source

Example ​

ts
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',
  }),
});
python
# 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"
    )
)
java
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());
csharp
// 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"
    })
});
go
// 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 #
Name to use for validating server certificate.

Default: The hostname of the splunk-url

caPathoptionalstringca_pathoptionalstrcaPathoptionalStringCaPathoptionalstringCaPathoptional*string #
Path to root certificate.

Default: caPath not set.

envoptionalstring[]envoptionaltyping.List[str]envoptionalList<String>Envoptionalstring[]Envoptional*[]*string #
The env option takes an array of keys.

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 #
The env-regex option is similar to and compatible with env.

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 #
Message format.

Can be inline, json or raw.

gzipoptionalbooleangzipoptionalboolgzipoptionalBooleanGzipoptionalboolGzipoptional*bool = false #
Enable/disable gzip compression to send events to Splunk Enterprise or Splunk Cloud instance.
gzipLeveloptionalnumbergzip_leveloptionalint | floatgzipLeveloptionalNumberGzipLeveloptionaldoubleGzipLeveloptional*float64 #
Set compression level for gzip.

Default: -1 (Default Compression)

Valid values are -1 (default), 0 (no compression), 1 (best speed) ... 9 (best compression).

indexoptionalstringindexoptionalstrindexoptionalStringIndexoptionalstringIndexoptional*string #
Event index.

Default: index not set.

insecureSkipVerifyoptionalstringinsecure_skip_verifyoptionalstrinsecureSkipVerifyoptionalStringInsecureSkipVerifyoptionalstringInsecureSkipVerifyoptional*string #
Ignore server certificate validation.

Default: insecureSkipVerify not set.

labelsoptionalstring[]labelsoptionaltyping.List[str]labelsoptionalList<String>Labelsoptionalstring[]Labelsoptional*[]*string #
The labels option takes an array of keys.

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.

secretTokenSecretsecret_tokenSecretsecretTokenSecretSecretTokenSecretSecretTokenSecret required #
Splunk HTTP Event Collector token (Secret).

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 #
Event source.

Default: source not set.

sourceTypeoptionalstringsource_typeoptionalstrsourceTypeoptionalStringSourceTypeoptionalstringSourceTypeoptional*string #
Event source type.

Default: sourceType not set.

tagoptionalstringtagoptionalstrtagoptionalStringTagoptionalstringTagoptional*string #
By default, Docker uses the first 12 characters of the container ID to tag log messages.

Default: The first 12 characters of the container ID

Refer to the log tag option documentation for customizing the log tag format.

urlstringurlstrurlStringUrlstringUrl*string required #
Path to your Splunk Enterprise, self-service Splunk Cloud instance, or Splunk Cloud managed cluster (including port and scheme used by HTTP Event Collector) in one of the following formats: https://your_splunk_instance:8088 or https://input-prd-p-XXXXXXX.cloud.splunk.com:8088 or https://http-inputs-XXXXXXXX.splunkcloud.com.
verifyConnectionoptionalbooleanverify_connectionoptionalboolverifyConnectionoptionalBooleanVerifyConnectionoptionalboolVerifyConnectionoptional*bool = true #
Verify on start, that docker can connect to Splunk server.