Class: AWSCDK::Logs::ParseKeyValueProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::ParseKeyValueProperty
- Defined in:
- logs/parse_key_value_property.rb
Overview
This processor parses a specified field in the original log event into key-value pairs.
For more information about this processor including examples, see parseKeyValue in the CloudWatch Logs User Guide.
Instance Attribute Summary collapse
-
#destination ⇒ String?
readonly
The destination field to put the extracted key-value pairs into.
-
#field_delimiter ⇒ AWSCDK::Logs::KeyValuePairDelimiter?
readonly
The field delimiter string that is used between key-value pairs in the original log events.
-
#key_prefix ⇒ String?
readonly
If you want to add a prefix to all transformed keys, specify it here.
-
#key_value_delimiter ⇒ AWSCDK::Logs::KeyValueDelimiter?
readonly
The delimiter string to use between the key and value in each pair in the transformed log event.
-
#non_match_value ⇒ String?
readonly
A value to insert into the value field in the result, when a key-value pair is not successfully split.
-
#overwrite_if_exists ⇒ Boolean?
readonly
Specifies whether to overwrite the value if the destination key already exists.
-
#source ⇒ String?
readonly
Path to the field in the log event that will be parsed.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(destination: nil, field_delimiter: nil, key_prefix: nil, key_value_delimiter: nil, non_match_value: nil, overwrite_if_exists: nil, source: nil) ⇒ ParseKeyValueProperty
constructor
A new instance of ParseKeyValueProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(destination: nil, field_delimiter: nil, key_prefix: nil, key_value_delimiter: nil, non_match_value: nil, overwrite_if_exists: nil, source: nil) ⇒ ParseKeyValueProperty
Returns a new instance of ParseKeyValueProperty.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'logs/parse_key_value_property.rb', line 16 def initialize(destination: nil, field_delimiter: nil, key_prefix: nil, key_value_delimiter: nil, non_match_value: nil, overwrite_if_exists: nil, source: nil) @destination = destination Jsii::Type.check_type(@destination, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "destination") unless @destination.nil? @field_delimiter = field_delimiter Jsii::Type.check_type(@field_delimiter, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5LZXlWYWx1ZVBhaXJEZWxpbWl0ZXIifQ==")), "fieldDelimiter") unless @field_delimiter.nil? @key_prefix = key_prefix Jsii::Type.check_type(@key_prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPrefix") unless @key_prefix.nil? @key_value_delimiter = key_value_delimiter Jsii::Type.check_type(@key_value_delimiter, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5LZXlWYWx1ZURlbGltaXRlciJ9")), "keyValueDelimiter") unless @key_value_delimiter.nil? @non_match_value = non_match_value Jsii::Type.check_type(@non_match_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nonMatchValue") unless @non_match_value.nil? @overwrite_if_exists = overwrite_if_exists Jsii::Type.check_type(@overwrite_if_exists, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "overwriteIfExists") unless @overwrite_if_exists.nil? @source = source Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") unless @source.nil? end |
Instance Attribute Details
#destination ⇒ String? (readonly)
Default: - Places at the root of the JSON input.
The destination field to put the extracted key-value pairs into.
37 38 39 |
# File 'logs/parse_key_value_property.rb', line 37 def destination @destination end |
#field_delimiter ⇒ AWSCDK::Logs::KeyValuePairDelimiter? (readonly)
Default: KeyValuePairDelimiter.AMPERSAND
The field delimiter string that is used between key-value pairs in the original log events.
42 43 44 |
# File 'logs/parse_key_value_property.rb', line 42 def field_delimiter @field_delimiter end |
#key_prefix ⇒ String? (readonly)
Default: - No prefix is added to the keys.
If you want to add a prefix to all transformed keys, specify it here.
47 48 49 |
# File 'logs/parse_key_value_property.rb', line 47 def key_prefix @key_prefix end |
#key_value_delimiter ⇒ AWSCDK::Logs::KeyValueDelimiter? (readonly)
Default: KeyValueDelimiter.EQUAL
The delimiter string to use between the key and value in each pair in the transformed log event.
52 53 54 |
# File 'logs/parse_key_value_property.rb', line 52 def key_value_delimiter @key_value_delimiter end |
#non_match_value ⇒ String? (readonly)
Default: - No values is inserted when split is not successful.
A value to insert into the value field in the result, when a key-value pair is not successfully split.
57 58 59 |
# File 'logs/parse_key_value_property.rb', line 57 def non_match_value @non_match_value end |
#overwrite_if_exists ⇒ Boolean? (readonly)
Default: false
Specifies whether to overwrite the value if the destination key already exists.
62 63 64 |
# File 'logs/parse_key_value_property.rb', line 62 def overwrite_if_exists @overwrite_if_exists end |
#source ⇒ String? (readonly)
Default: '@message'
Path to the field in the log event that will be parsed.
Use dot notation to access child fields.
69 70 71 |
# File 'logs/parse_key_value_property.rb', line 69 def source @source end |
Class Method Details
.jsii_properties ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 |
# File 'logs/parse_key_value_property.rb', line 71 def self.jsii_properties { :destination => "destination", :field_delimiter => "fieldDelimiter", :key_prefix => "keyPrefix", :key_value_delimiter => "keyValueDelimiter", :non_match_value => "nonMatchValue", :overwrite_if_exists => "overwriteIfExists", :source => "source", } end |
Instance Method Details
#to_jsii ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'logs/parse_key_value_property.rb', line 83 def to_jsii result = {} result.merge!({ "destination" => @destination, "fieldDelimiter" => @field_delimiter, "keyPrefix" => @key_prefix, "keyValueDelimiter" => @key_value_delimiter, "nonMatchValue" => @non_match_value, "overwriteIfExists" => @overwrite_if_exists, "source" => @source, }) result.compact end |