Class: AWSCDK::Logs::GrokProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::GrokProperty
- Defined in:
- logs/grok_property.rb
Overview
This processor uses pattern matching to parse and structure unstructured data.
This processor can also extract fields from log messages. For more information about this processor including examples, see grok in the CloudWatch Logs User Guide.
Instance Attribute Summary collapse
-
#match ⇒ String
readonly
The grok pattern to match against the log event.
-
#source ⇒ String?
readonly
The path to the field in the log event that you want to parse.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(match:, source: nil) ⇒ GrokProperty
constructor
A new instance of GrokProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(match:, source: nil) ⇒ GrokProperty
Returns a new instance of GrokProperty.
12 13 14 15 16 17 |
# File 'logs/grok_property.rb', line 12 def initialize(match:, source: nil) @match = match Jsii::Type.check_type(@match, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "match") @source = source Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") unless @source.nil? end |
Instance Attribute Details
#match ⇒ String (readonly)
The grok pattern to match against the log event.
For a list of supported grok patterns, see Supported grok patterns in the CloudWatch Logs User Guide.
25 26 27 |
# File 'logs/grok_property.rb', line 25 def match @match end |
#source ⇒ String? (readonly)
Note:
Default: '@message'
The path to the field in the log event that you want to parse.
30 31 32 |
# File 'logs/grok_property.rb', line 30 def source @source end |
Class Method Details
.jsii_properties ⇒ Object
32 33 34 35 36 37 |
# File 'logs/grok_property.rb', line 32 def self.jsii_properties { :match => "match", :source => "source", } end |
Instance Method Details
#to_jsii ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'logs/grok_property.rb', line 39 def to_jsii result = {} result.merge!({ "match" => @match, "source" => @source, }) result.compact end |