aws-cdk-lib.aws_ecs.SplunkLogDriverProps

interface SplunkLogDriverProps

LanguageType name
.NETAmazon.CDK.AWS.ECS.SplunkLogDriverProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#SplunkLogDriverProps
Javasoftware.amazon.awscdk.services.ecs.SplunkLogDriverProps
Pythonaws_cdk.aws_ecs.SplunkLogDriverProps
TypeScript (source)aws-cdk-lib » aws_ecs » SplunkLogDriverProps

Specifies the splunk log driver configuration options.

Source

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',
  }),
});

Properties

NameTypeDescription
secretTokenSecretSplunk HTTP Event Collector token (Secret).
urlstringPath 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.
caName?stringName to use for validating server certificate.
caPath?stringPath to root certificate.
env?string[]The env option takes an array of keys.
envRegex?stringThe env-regex option is similar to and compatible with env.
format?SplunkLogFormatMessage format.
gzip?booleanEnable/disable gzip compression to send events to Splunk Enterprise or Splunk Cloud instance.
gzipLevel?numberSet compression level for gzip.
index?stringEvent index.
insecureSkipVerify?stringIgnore server certificate validation.
labels?string[]The labels option takes an array of keys.
source?stringEvent source.
sourceType?stringEvent source type.
tag?stringBy default, Docker uses the first 12 characters of the container ID to tag log messages.
verifyConnection?booleanVerify on start, that docker can connect to Splunk server.

secretToken

Type: Secret

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.


url

Type: string

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.


caName?

Type: string (optional, default: The hostname of the splunk-url)

Name to use for validating server certificate.


caPath?

Type: string (optional, default: caPath not set.)

Path to root certificate.


env?

Type: string[] (optional, default: No env)

The env option takes an array of keys.

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.


envRegex?

Type: string (optional, default: No envRegex)

The env-regex option is similar to and compatible with env.

Its value is a regular expression to match logging-related environment variables. It is used for advanced log tag options.


format?

Type: SplunkLogFormat (optional, default: inline)

Message format.

Can be inline, json or raw.


gzip?

Type: boolean (optional, default: false)

Enable/disable gzip compression to send events to Splunk Enterprise or Splunk Cloud instance.


gzipLevel?

Type: number (optional, default: -1 (Default Compression))

Set compression level for gzip.

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


index?

Type: string (optional, default: index not set.)

Event index.


insecureSkipVerify?

Type: string (optional, default: insecureSkipVerify not set.)

Ignore server certificate validation.


labels?

Type: string[] (optional, default: No labels)

The labels option takes an array of keys.

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.


source?

Type: string (optional, default: source not set.)

Event source.


sourceType?

Type: string (optional, default: sourceType not set.)

Event source type.


tag?

Type: string (optional, default: The first 12 characters of the container ID)

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

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


verifyConnection?

Type: boolean (optional, default: true)

Verify on start, that docker can connect to Splunk server.