# SplunkLogDriverProps

Specifies the splunk log driver configuration options.

[Source](https://docs.docker.com/config/containers/logging/splunk/)

Extends: SplunkLogDriverProps
Extends: BaseLogDriverProps
Used as props by: SplunkLogDriver

- Source: [`aws-ecs/lib/log-drivers/splunk-log-driver.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs/lib/log-drivers/splunk-log-driver.ts#L25)
- Type last changed: v2.40.0 · 1 Sep 2022

## 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

- `caName`: string — Name to use for validating server certificate.

  **Default:** The hostname of the splunk-url

- `caPath`: string — Path to root certificate.

  **Default:** caPath not set.

- `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.

- `envRegex`: 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.

- `format`: [SplunkLogFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.SplunkLogFormat.html) = inline — Message format.

  Can be inline, json or raw.

- `gzip`: boolean = false — Enable/disable gzip compression to send events to Splunk Enterprise or Splunk Cloud instance.

- `gzipLevel`: number — Set compression level for gzip.

  **Default:** -1 (Default Compression)

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

- `index`: string — Event index.

  **Default:** index not set.

- `insecureSkipVerify`: string — Ignore server certificate validation.

  **Default:** insecureSkipVerify not set.

- `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.

- `secretToken`: [Secret](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.Secret.html) (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.

- `source`: string — Event source.

  **Default:** source not set.

- `sourceType`: string — Event source type.

  **Default:** sourceType not set.

- `tag`: 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.

- `url`: 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.

- `verifyConnection`: boolean = true — Verify on start, that docker can connect to Splunk server.
