Skip to content
v2.274.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',
  }),
});

Properties ​

caNamestringca_namestrcaNameStringCaNamestringCaName*string#
Name to use for validating server certificate.

Default: The hostname of the splunk-url

caPathstringca_pathstrcaPathStringCaPathstringCaPath*string#
Path to root certificate.

Default: caPath not set.

envstring[]envtyping.List[str]envList<String>Envstring[]Env*[]*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.

envRegexstringenv_regexstrenvRegexStringEnvRegexstringEnvRegex*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.

Message format.

Can be inline, json or raw.

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

Default: -1 (Default Compression)

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

indexstringindexstrindexStringIndexstringIndex*string#
Event index.

Default: index not set.

insecureSkipVerifystringinsecure_skip_verifystrinsecureSkipVerifyStringInsecureSkipVerifystringInsecureSkipVerify*string#
Ignore server certificate validation.

Default: insecureSkipVerify not set.

labelsstring[]labelstyping.List[str]labelsList<String>Labelsstring[]Labels*[]*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_tokenSecretsecretTokenSecretSecretTokenSecretSecretTokenSecretrequired#
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.

sourcestringsourcestrsourceStringSourcestringSource*string#
Event source.

Default: source not set.

sourceTypestringsource_typestrsourceTypeStringSourceTypestringSourceType*string#
Event source type.

Default: sourceType not set.

tagstringtagstrtagStringTagstringTag*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*stringrequired#
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.
verifyConnectionbooleanverify_connectionboolverifyConnectionBooleanVerifyConnectionboolVerifyConnection*bool= true#
Verify on start, that docker can connect to Splunk server.