Class: AWSCDK::Logs::DateTimeConverterProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/date_time_converter_property.rb

Overview

This processor converts a datetime string into a format that you specify.

For more information about this processor including examples, see datetimeConverter in the CloudWatch Logs User Guide.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale:, match_patterns:, source:, target:, source_timezone: nil, target_format: nil, target_timezone: nil) ⇒ DateTimeConverterProperty

Returns a new instance of DateTimeConverterProperty.

Parameters:

  • locale (String)

    The locale of the source field.

  • match_patterns (Array<String>)

    A list of patterns to match against the source field.

  • source (String)

    The key to apply the date conversion to.

  • target (String)

    The JSON field to store the result in.

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

    The time zone of the source field.

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

    The datetime format to use for the converted data in the target field.

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

    The time zone of the target field.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'logs/date_time_converter_property.rb', line 16

def initialize(locale:, match_patterns:, source:, target:, source_timezone: nil, target_format: nil, target_timezone: nil)
  @locale = locale
  Jsii::Type.check_type(@locale, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "locale")
  @match_patterns = match_patterns
  Jsii::Type.check_type(@match_patterns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "matchPatterns")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
  @target = target
  Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target")
  @source_timezone = source_timezone
  Jsii::Type.check_type(@source_timezone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceTimezone") unless @source_timezone.nil?
  @target_format = target_format
  Jsii::Type.check_type(@target_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetFormat") unless @target_format.nil?
  @target_timezone = target_timezone
  Jsii::Type.check_type(@target_timezone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetTimezone") unless @target_timezone.nil?
end

Instance Attribute Details

#localeString (readonly)

The locale of the source field.

Returns:

  • (String)


36
37
38
# File 'logs/date_time_converter_property.rb', line 36

def locale
  @locale
end

#match_patternsArray<String> (readonly)

A list of patterns to match against the source field.

Returns:

  • (Array<String>)


40
41
42
# File 'logs/date_time_converter_property.rb', line 40

def match_patterns
  @match_patterns
end

#sourceString (readonly)

The key to apply the date conversion to.

Returns:

  • (String)


44
45
46
# File 'logs/date_time_converter_property.rb', line 44

def source
  @source
end

#source_timezoneString? (readonly)

Note:

Default: UTC

The time zone of the source field.

Returns:

  • (String, nil)


53
54
55
# File 'logs/date_time_converter_property.rb', line 53

def source_timezone
  @source_timezone
end

#targetString (readonly)

The JSON field to store the result in.

Returns:

  • (String)


48
49
50
# File 'logs/date_time_converter_property.rb', line 48

def target
  @target
end

#target_formatString? (readonly)

Note:

Default: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"

The datetime format to use for the converted data in the target field.

Returns:

  • (String, nil)


58
59
60
# File 'logs/date_time_converter_property.rb', line 58

def target_format
  @target_format
end

#target_timezoneString? (readonly)

Note:

Default: UTC

The time zone of the target field.

Returns:

  • (String, nil)


63
64
65
# File 'logs/date_time_converter_property.rb', line 63

def target_timezone
  @target_timezone
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
74
75
# File 'logs/date_time_converter_property.rb', line 65

def self.jsii_properties
  {
    :locale => "locale",
    :match_patterns => "matchPatterns",
    :source => "source",
    :target => "target",
    :source_timezone => "sourceTimezone",
    :target_format => "targetFormat",
    :target_timezone => "targetTimezone",
  }
end

Instance Method Details

#to_jsiiObject



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'logs/date_time_converter_property.rb', line 77

def to_jsii
  result = {}
  result.merge!({
    "locale" => @locale,
    "matchPatterns" => @match_patterns,
    "source" => @source,
    "target" => @target,
    "sourceTimezone" => @source_timezone,
    "targetFormat" => @target_format,
    "targetTimezone" => @target_timezone,
  })
  result.compact
end