Class: AWSCDK::Logs::CfnTransformer::GrokProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/cfn_transformer.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(match:, source: nil) ⇒ GrokProperty

Returns a new instance of GrokProperty.

Parameters:

  • match (String)

    The grok pattern to match against the log event.

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

    The path to the field in the log event that you want to parse.



917
918
919
920
921
922
# File 'logs/cfn_transformer.rb', line 917

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

#matchString (readonly)

The grok pattern to match against the log event.

For a list of supported grok patterns, see Supported grok patterns .



930
931
932
# File 'logs/cfn_transformer.rb', line 930

def match
  @match
end

#sourceString? (readonly)

The path to the field in the log event that you want to parse.

If you omit this value, the whole log message is parsed.



937
938
939
# File 'logs/cfn_transformer.rb', line 937

def source
  @source
end

Class Method Details

.jsii_propertiesObject



939
940
941
942
943
944
# File 'logs/cfn_transformer.rb', line 939

def self.jsii_properties
  {
    :match => "match",
    :source => "source",
  }
end

Instance Method Details

#to_jsiiObject



946
947
948
949
950
951
952
953
# File 'logs/cfn_transformer.rb', line 946

def to_jsii
  result = {}
  result.merge!({
    "match" => @match,
    "source" => @source,
  })
  result.compact
end