Class: AWSCDK::ECS::SplunkLogDriverProps

Inherits:
BaseLogDriverProps
  • Object
show all
Defined in:
ecs/splunk_log_driver_props.rb

Overview

Specifies the splunk log driver configuration options.

Source

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env: nil, env_regex: nil, labels: nil, tag: nil, secret_token:, url:, ca_name: nil, ca_path: nil, format: nil, gzip: nil, gzip_level: nil, index: nil, insecure_skip_verify: nil, source: nil, source_type: nil, verify_connection: nil) ⇒ SplunkLogDriverProps

Returns a new instance of SplunkLogDriverProps.

Parameters:

  • env (Array<String>, nil) (defaults to: nil)

    The env option takes an array of keys.

  • env_regex (String, nil) (defaults to: nil)

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

  • labels (Array<String>, nil) (defaults to: nil)

    The labels option takes an array of keys.

  • tag (String, nil) (defaults to: nil)

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

  • secret_token (AWSCDK::ECS::Secret)

    Splunk HTTP Event Collector token (Secret).

  • url (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.

  • ca_name (String, nil) (defaults to: nil)

    Name to use for validating server certificate.

  • ca_path (String, nil) (defaults to: nil)

    Path to root certificate.

  • format (AWSCDK::ECS::SplunkLogFormat, nil) (defaults to: nil)

    Message format.

  • gzip (Boolean, nil) (defaults to: nil)

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

  • gzip_level (Numeric, nil) (defaults to: nil)

    Set compression level for gzip.

  • index (String, nil) (defaults to: nil)

    Event index.

  • insecure_skip_verify (String, nil) (defaults to: nil)

    Ignore server certificate validation.

  • source (String, nil) (defaults to: nil)

    Event source.

  • source_type (String, nil) (defaults to: nil)

    Event source type.

  • verify_connection (Boolean, nil) (defaults to: nil)

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



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'ecs/splunk_log_driver_props.rb', line 25

def initialize(env: nil, env_regex: nil, labels: nil, tag: nil, secret_token:, url:, ca_name: nil, ca_path: nil, format: nil, gzip: nil, gzip_level: nil, index: nil, insecure_skip_verify: nil, source: nil, source_type: nil, verify_connection: nil)
  @env = env
  Jsii::Type.check_type(@env, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "env") unless @env.nil?
  @env_regex = env_regex
  Jsii::Type.check_type(@env_regex, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "envRegex") unless @env_regex.nil?
  @labels = labels
  Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "labels") unless @labels.nil?
  @tag = tag
  Jsii::Type.check_type(@tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag") unless @tag.nil?
  @secret_token = secret_token
  Jsii::Type.check_type(@secret_token, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlNlY3JldCJ9")), "secretToken")
  @url = url
  Jsii::Type.check_type(@url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "url")
  @ca_name = ca_name
  Jsii::Type.check_type(@ca_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "caName") unless @ca_name.nil?
  @ca_path = ca_path
  Jsii::Type.check_type(@ca_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "caPath") unless @ca_path.nil?
  @format = format
  Jsii::Type.check_type(@format, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlNwbHVua0xvZ0Zvcm1hdCJ9")), "format") unless @format.nil?
  @gzip = gzip
  Jsii::Type.check_type(@gzip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "gzip") unless @gzip.nil?
  @gzip_level = gzip_level
  Jsii::Type.check_type(@gzip_level, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "gzipLevel") unless @gzip_level.nil?
  @index = index
  Jsii::Type.check_type(@index, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "index") unless @index.nil?
  @insecure_skip_verify = insecure_skip_verify
  Jsii::Type.check_type(@insecure_skip_verify, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "insecureSkipVerify") unless @insecure_skip_verify.nil?
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") unless @source.nil?
  @source_type = source_type
  Jsii::Type.check_type(@source_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceType") unless @source_type.nil?
  @verify_connection = verify_connection
  Jsii::Type.check_type(@verify_connection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "verifyConnection") unless @verify_connection.nil?
end

Instance Attribute Details

#ca_nameString? (readonly)

Note:

Default: - The hostname of the splunk-url

Name to use for validating server certificate.

Returns:

  • (String, nil)


110
111
112
# File 'ecs/splunk_log_driver_props.rb', line 110

def ca_name
  @ca_name
end

#ca_pathString? (readonly)

Note:

Default: - caPath not set.

Path to root certificate.

Returns:

  • (String, nil)


115
116
117
# File 'ecs/splunk_log_driver_props.rb', line 115

def ca_path
  @ca_path
end

#envArray<String>? (readonly)

Note:

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.

Returns:

  • (Array<String>, nil)


68
69
70
# File 'ecs/splunk_log_driver_props.rb', line 68

def env
  @env
end

#env_regexString? (readonly)

Note:

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.

Returns:

  • (String, nil)


77
78
79
# File 'ecs/splunk_log_driver_props.rb', line 77

def env_regex
  @env_regex
end

#formatAWSCDK::ECS::SplunkLogFormat? (readonly)

Note:

Default: - inline

Message format.

Can be inline, json or raw.



122
123
124
# File 'ecs/splunk_log_driver_props.rb', line 122

def format
  @format
end

#gzipBoolean? (readonly)

Note:

Default: - false

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

Returns:

  • (Boolean, nil)


127
128
129
# File 'ecs/splunk_log_driver_props.rb', line 127

def gzip
  @gzip
end

#gzip_levelNumeric? (readonly)

Note:

Default: - -1 (Default Compression)

Set compression level for gzip.

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

Returns:

  • (Numeric, nil)


135
136
137
# File 'ecs/splunk_log_driver_props.rb', line 135

def gzip_level
  @gzip_level
end

#indexString? (readonly)

Note:

Default: - index not set.

Event index.

Returns:

  • (String, nil)


140
141
142
# File 'ecs/splunk_log_driver_props.rb', line 140

def index
  @index
end

#insecure_skip_verifyString? (readonly)

Note:

Default: - insecureSkipVerify not set.

Ignore server certificate validation.

Returns:

  • (String, nil)


145
146
147
# File 'ecs/splunk_log_driver_props.rb', line 145

def insecure_skip_verify
  @insecure_skip_verify
end

#labelsArray<String>? (readonly)

Note:

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.

Returns:

  • (Array<String>, nil)


86
87
88
# File 'ecs/splunk_log_driver_props.rb', line 86

def labels
  @labels
end

#secret_tokenAWSCDK::ECS::Secret (readonly)

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.

Returns:



101
102
103
# File 'ecs/splunk_log_driver_props.rb', line 101

def secret_token
  @secret_token
end

#sourceString? (readonly)

Note:

Default: - source not set.

Event source.

Returns:

  • (String, nil)


150
151
152
# File 'ecs/splunk_log_driver_props.rb', line 150

def source
  @source
end

#source_typeString? (readonly)

Note:

Default: - sourceType not set.

Event source type.

Returns:

  • (String, nil)


155
156
157
# File 'ecs/splunk_log_driver_props.rb', line 155

def source_type
  @source_type
end

#tagString? (readonly)

Note:

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.

Returns:

  • (String, nil)


94
95
96
# File 'ecs/splunk_log_driver_props.rb', line 94

def tag
  @tag
end

#urlString (readonly)

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.

Returns:

  • (String)


105
106
107
# File 'ecs/splunk_log_driver_props.rb', line 105

def url
  @url
end

#verify_connectionBoolean? (readonly)

Note:

Default: - true

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

Returns:

  • (Boolean, nil)


160
161
162
# File 'ecs/splunk_log_driver_props.rb', line 160

def verify_connection
  @verify_connection
end

Class Method Details

.jsii_propertiesObject



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'ecs/splunk_log_driver_props.rb', line 162

def self.jsii_properties
  {
    :env => "env",
    :env_regex => "envRegex",
    :labels => "labels",
    :tag => "tag",
    :secret_token => "secretToken",
    :url => "url",
    :ca_name => "caName",
    :ca_path => "caPath",
    :format => "format",
    :gzip => "gzip",
    :gzip_level => "gzipLevel",
    :index => "index",
    :insecure_skip_verify => "insecureSkipVerify",
    :source => "source",
    :source_type => "sourceType",
    :verify_connection => "verifyConnection",
  }
end

Instance Method Details

#to_jsiiObject



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'ecs/splunk_log_driver_props.rb', line 183

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "env" => @env,
    "envRegex" => @env_regex,
    "labels" => @labels,
    "tag" => @tag,
    "secretToken" => @secret_token,
    "url" => @url,
    "caName" => @ca_name,
    "caPath" => @ca_path,
    "format" => @format,
    "gzip" => @gzip,
    "gzipLevel" => @gzip_level,
    "index" => @index,
    "insecureSkipVerify" => @insecure_skip_verify,
    "source" => @source,
    "sourceType" => @source_type,
    "verifyConnection" => @verify_connection,
  })
  result.compact
end