Class: AWSCDK::Logs::ListToMapProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::ListToMapProperty
- Defined in:
- logs/list_to_map_property.rb
Overview
This processor takes a list of objects that contain key fields, and converts them into a map of target keys.
For more information about this processor including examples, see listToMap in the CloudWatch Logs User Guide.
Instance Attribute Summary collapse
-
#flatten ⇒ Boolean?
readonly
A Boolean value to indicate whether the list will be flattened into single items.
-
#flattened_element ⇒ String?
readonly
If you set flatten to true, use flattenedElement to specify which element, first or last, to keep.
-
#key ⇒ String
readonly
The key of the field to be extracted as keys in the generated map.
-
#source ⇒ String
readonly
The key in the log event that has a list of objects that will be converted to a map.
-
#target ⇒ String?
readonly
The key of the field that will hold the generated map.
-
#value_key ⇒ String?
readonly
If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) ⇒ ListToMapProperty
constructor
A new instance of ListToMapProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) ⇒ ListToMapProperty
Returns a new instance of ListToMapProperty.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'logs/list_to_map_property.rb', line 15 def initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) @key = key Jsii::Type.check_type(@key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key") @source = source Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") @flatten = flatten Jsii::Type.check_type(@flatten, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "flatten") unless @flatten.nil? @flattened_element = flattened_element Jsii::Type.check_type(@flattened_element, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "flattenedElement") unless @flattened_element.nil? @target = target Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target") unless @target.nil? @value_key = value_key Jsii::Type.check_type(@value_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "valueKey") unless @value_key.nil? end |
Instance Attribute Details
#flatten ⇒ Boolean? (readonly)
Default: false
A Boolean value to indicate whether the list will be flattened into single items.
42 43 44 |
# File 'logs/list_to_map_property.rb', line 42 def flatten @flatten end |
#flattened_element ⇒ String? (readonly)
Default: - Must be specified if flatten is true and if flatten is false, has no effect
If you set flatten to true, use flattenedElement to specify which element, first or last, to keep.
You must specify this parameter if flatten is true.
49 50 51 |
# File 'logs/list_to_map_property.rb', line 49 def flattened_element @flattened_element end |
#key ⇒ String (readonly)
The key of the field to be extracted as keys in the generated map.
33 34 35 |
# File 'logs/list_to_map_property.rb', line 33 def key @key end |
#source ⇒ String (readonly)
The key in the log event that has a list of objects that will be converted to a map.
37 38 39 |
# File 'logs/list_to_map_property.rb', line 37 def source @source end |
#target ⇒ String? (readonly)
Default: - Stored at the root of the log event
The key of the field that will hold the generated map.
54 55 56 |
# File 'logs/list_to_map_property.rb', line 54 def target @target end |
#value_key ⇒ String? (readonly)
Default: - Original objects in the source list will be put into the values of the generated map
If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map.
59 60 61 |
# File 'logs/list_to_map_property.rb', line 59 def value_key @value_key end |
Class Method Details
.jsii_properties ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'logs/list_to_map_property.rb', line 61 def self.jsii_properties { :key => "key", :source => "source", :flatten => "flatten", :flattened_element => "flattenedElement", :target => "target", :value_key => "valueKey", } end |
Instance Method Details
#to_jsii ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'logs/list_to_map_property.rb', line 72 def to_jsii result = {} result.merge!({ "key" => @key, "source" => @source, "flatten" => @flatten, "flattenedElement" => @flattened_element, "target" => @target, "valueKey" => @value_key, }) result.compact end |