Class: AWSCDK::Logs::CsvProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Logs::CsvProperty
- Defined in:
- logs/csv_property.rb
Overview
The CSV processor parses comma-separated values (CSV) from the log events into columns.
For more information about this processor including examples, see csv in the CloudWatch Logs User Guide.
Instance Attribute Summary collapse
-
#columns ⇒ Array<String>?
readonly
An array of names to use for the columns in the transformed log event.
-
#delimiter ⇒ AWSCDK::Logs::DelimiterCharacter?
readonly
Character used to separate each column in the original comma-separated value log event.
-
#quote_character ⇒ AWSCDK::Logs::QuoteCharacter?
readonly
Character used as a text qualifier for a single column of data.
-
#source ⇒ String?
readonly
The path to the field in the log event that has the comma separated values to be parsed.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(columns: nil, delimiter: nil, quote_character: nil, source: nil) ⇒ CsvProperty
constructor
A new instance of CsvProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(columns: nil, delimiter: nil, quote_character: nil, source: nil) ⇒ CsvProperty
Returns a new instance of CsvProperty.
13 14 15 16 17 18 19 20 21 22 |
# File 'logs/csv_property.rb', line 13 def initialize(columns: nil, delimiter: nil, quote_character: nil, source: nil) @columns = columns Jsii::Type.check_type(@columns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "columns") unless @columns.nil? @delimiter = delimiter Jsii::Type.check_type(@delimiter, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5EZWxpbWl0ZXJDaGFyYWN0ZXIifQ==")), "delimiter") unless @delimiter.nil? @quote_character = quote_character Jsii::Type.check_type(@quote_character, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5RdW90ZUNoYXJhY3RlciJ9")), "quoteCharacter") unless @quote_character.nil? @source = source Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source") unless @source.nil? end |
Instance Attribute Details
#columns ⇒ Array<String>? (readonly)
Default: - Column names ([column_1, column_2 ...]) are used
An array of names to use for the columns in the transformed log event.
28 29 30 |
# File 'logs/csv_property.rb', line 28 def columns @columns end |
#delimiter ⇒ AWSCDK::Logs::DelimiterCharacter? (readonly)
Default: DelimiterCharacter.COMMA
Character used to separate each column in the original comma-separated value log event.
33 34 35 |
# File 'logs/csv_property.rb', line 33 def delimiter @delimiter end |
#quote_character ⇒ AWSCDK::Logs::QuoteCharacter? (readonly)
Default: QuoteCharacter.DOUBLE_QUOTE
Character used as a text qualifier for a single column of data.
38 39 40 |
# File 'logs/csv_property.rb', line 38 def quote_character @quote_character end |
#source ⇒ String? (readonly)
Default: '@message'
The path to the field in the log event that has the comma separated values to be parsed.
43 44 45 |
# File 'logs/csv_property.rb', line 43 def source @source end |
Class Method Details
.jsii_properties ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'logs/csv_property.rb', line 45 def self.jsii_properties { :columns => "columns", :delimiter => "delimiter", :quote_character => "quoteCharacter", :source => "source", } end |
Instance Method Details
#to_jsii ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'logs/csv_property.rb', line 54 def to_jsii result = {} result.merge!({ "columns" => @columns, "delimiter" => @delimiter, "quoteCharacter" => @quote_character, "source" => @source, }) result.compact end |