Class: AWSCDK::Logs::ParserProcessorProps

Inherits:
BaseProcessorProps
  • Object
show all
Defined in:
logs/parser_processor_props.rb

Overview

Properties for creating configurable parser processors.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, csv_options: nil, grok_options: nil, json_options: nil, key_value_options: nil, parse_to_ocsf_options: nil) ⇒ ParserProcessorProps

Returns a new instance of ParserProcessorProps.

Parameters:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'logs/parser_processor_props.rb', line 13

def initialize(type:, csv_options: nil, grok_options: nil, json_options: nil, key_value_options: nil, parse_to_ocsf_options: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5QYXJzZXJQcm9jZXNzb3JUeXBlIn0=")), "type")
  @csv_options = csv_options.is_a?(Hash) ? ::AWSCDK::Logs::CsvProperty.new(**csv_options.transform_keys(&:to_sym)) : csv_options
  Jsii::Type.check_type(@csv_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5Dc3ZQcm9wZXJ0eSJ9")), "csvOptions") unless @csv_options.nil?
  @grok_options = grok_options.is_a?(Hash) ? ::AWSCDK::Logs::GrokProperty.new(**grok_options.transform_keys(&:to_sym)) : grok_options
  Jsii::Type.check_type(@grok_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5Hcm9rUHJvcGVydHkifQ==")), "grokOptions") unless @grok_options.nil?
  @json_options = json_options.is_a?(Hash) ? ::AWSCDK::Logs::ParseJSONProperty.new(**json_options.transform_keys(&:to_sym)) : json_options
  Jsii::Type.check_type(@json_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5QYXJzZUpTT05Qcm9wZXJ0eSJ9")), "jsonOptions") unless @json_options.nil?
  @key_value_options = key_value_options.is_a?(Hash) ? ::AWSCDK::Logs::ParseKeyValueProperty.new(**key_value_options.transform_keys(&:to_sym)) : key_value_options
  Jsii::Type.check_type(@key_value_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5QYXJzZUtleVZhbHVlUHJvcGVydHkifQ==")), "keyValueOptions") unless @key_value_options.nil?
  @parse_to_ocsf_options = parse_to_ocsf_options.is_a?(Hash) ? ::AWSCDK::Logs::ParseToOCSFProperty.new(**parse_to_ocsf_options.transform_keys(&:to_sym)) : parse_to_ocsf_options
  Jsii::Type.check_type(@parse_to_ocsf_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5QYXJzZVRvT0NTRlByb3BlcnR5In0=")), "parseToOCSFOptions") unless @parse_to_ocsf_options.nil?
end

Instance Attribute Details

#csv_optionsAWSCDK::Logs::CsvProperty? (readonly)

Note:

Default: - No CSV parser is created if props not set

Options for CSV parser.

Required when type is CSV.

Returns:



38
39
40
# File 'logs/parser_processor_props.rb', line 38

def csv_options
  @csv_options
end

#grok_optionsAWSCDK::Logs::GrokProperty? (readonly)

Note:

Default: - No Grok parser is created if props not set

Options for Grok parser.

Required when type is GROK.

Returns:



45
46
47
# File 'logs/parser_processor_props.rb', line 45

def grok_options
  @grok_options
end

#json_optionsAWSCDK::Logs::ParseJSONProperty? (readonly)

Note:

Default: - No JSON parser is created if props not set

Options for JSON parser.

Required when type is JSON.



52
53
54
# File 'logs/parser_processor_props.rb', line 52

def json_options
  @json_options
end

#key_value_optionsAWSCDK::Logs::ParseKeyValueProperty? (readonly)

Note:

Default: - No key-value parser is created if props not set

Options for key-value parser.

Required when type is KEY_VALUE.



59
60
61
# File 'logs/parser_processor_props.rb', line 59

def key_value_options
  @key_value_options
end

#parse_to_ocsf_optionsAWSCDK::Logs::ParseToOCSFProperty? (readonly)

Note:

Default: - no OCSF parser is created.

Options for ParseToOCSF parser.

Required when type is set to OCSF



66
67
68
# File 'logs/parser_processor_props.rb', line 66

def parse_to_ocsf_options
  @parse_to_ocsf_options
end

#typeAWSCDK::Logs::ParserProcessorType (readonly)

The type of parser processor.



31
32
33
# File 'logs/parser_processor_props.rb', line 31

def type
  @type
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
# File 'logs/parser_processor_props.rb', line 68

def self.jsii_properties
  {
    :type => "type",
    :csv_options => "csvOptions",
    :grok_options => "grokOptions",
    :json_options => "jsonOptions",
    :key_value_options => "keyValueOptions",
    :parse_to_ocsf_options => "parseToOCSFOptions",
  }
end

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'logs/parser_processor_props.rb', line 79

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "type" => @type,
    "csvOptions" => @csv_options,
    "grokOptions" => @grok_options,
    "jsonOptions" => @json_options,
    "keyValueOptions" => @key_value_options,
    "parseToOCSFOptions" => @parse_to_ocsf_options,
  })
  result.compact
end