Class: AWSCDK::Logs::CfnTransformer::ParseJSONProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::CfnTransformer::ParseJSONProperty
- Defined in:
- logs/cfn_transformer.rb
Overview
This processor parses log events that are in JSON format.
It can extract JSON key-value pairs and place them under a destination that you specify.
Additionally, because you must have at least one parse-type processor in a transformer, you can use ParseJSON as that processor for JSON-format logs, so that you can also apply other processors, such as mutate processors, to these logs.
For more information about this processor including examples, see parseJSON in the CloudWatch Logs User Guide .
Instance Attribute Summary collapse
-
#destination ⇒ String?
readonly
The location to put the parsed key value pair into.
-
#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, source: nil) ⇒ ParseJSONProperty
constructor
A new instance of ParseJSONProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(destination: nil, source: nil) ⇒ ParseJSONProperty
Returns a new instance of ParseJSONProperty.
1227 1228 1229 1230 1231 1232 |
# File 'logs/cfn_transformer.rb', line 1227 def initialize(destination: nil, source: nil) @destination = destination Jsii::Type.check_type(@destination, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "destination") unless @destination.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)
The location to put the parsed key value pair into.
If you omit this parameter, it is placed under the root node.
1240 1241 1242 |
# File 'logs/cfn_transformer.rb', line 1240 def destination @destination end |
#source ⇒ String? (readonly)
Path to the field in the log event that will be parsed.
Use dot notation to access child fields. For example, store.book
1247 1248 1249 |
# File 'logs/cfn_transformer.rb', line 1247 def source @source end |
Class Method Details
.jsii_properties ⇒ Object
1249 1250 1251 1252 1253 1254 |
# File 'logs/cfn_transformer.rb', line 1249 def self.jsii_properties { :destination => "destination", :source => "source", } end |
Instance Method Details
#to_jsii ⇒ Object
1256 1257 1258 1259 1260 1261 1262 1263 |
# File 'logs/cfn_transformer.rb', line 1256 def to_jsii result = {} result.merge!({ "destination" => @destination, "source" => @source, }) result.compact end |