Class: AWSCDK::Logs::CfnTransformer::CsvProperty

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(columns: nil, delimiter: nil, quote_character: nil, source: nil) ⇒ CsvProperty

Returns a new instance of CsvProperty.

Parameters:

  • columns (Array<String>, nil) (defaults to: nil)

    An array of names to use for the columns in the transformed log event.

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

    The character used to separate each column in the original comma-separated value log event.

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

    The character used used as a text qualifier for a single column of data.

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

    The path to the field in the log event that has the comma separated values to be parsed.



706
707
708
709
710
711
712
713
714
715
# File 'logs/cfn_transformer.rb', line 706

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("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "delimiter") unless @delimiter.nil?
  @quote_character = quote_character
  Jsii::Type.check_type(@quote_character, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "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

#columnsArray<String>? (readonly)

An array of names to use for the columns in the transformed log event.

If you omit this, default column names ( [column_1, column_2 ...] ) are used.



723
724
725
# File 'logs/cfn_transformer.rb', line 723

def columns
  @columns
end

#delimiterString? (readonly)

The character used to separate each column in the original comma-separated value log event.

If you omit this, the processor looks for the comma , character as the delimiter.



730
731
732
# File 'logs/cfn_transformer.rb', line 730

def delimiter
  @delimiter
end

#quote_characterString? (readonly)

The character used used as a text qualifier for a single column of data.

If you omit this, the double quotation mark " character is used.



737
738
739
# File 'logs/cfn_transformer.rb', line 737

def quote_character
  @quote_character
end

#sourceString? (readonly)

The path to the field in the log event that has the comma separated values to be parsed.

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



744
745
746
# File 'logs/cfn_transformer.rb', line 744

def source
  @source
end

Class Method Details

.jsii_propertiesObject



746
747
748
749
750
751
752
753
# File 'logs/cfn_transformer.rb', line 746

def self.jsii_properties
  {
    :columns => "columns",
    :delimiter => "delimiter",
    :quote_character => "quoteCharacter",
    :source => "source",
  }
end

Instance Method Details

#to_jsiiObject



755
756
757
758
759
760
761
762
763
764
# File 'logs/cfn_transformer.rb', line 755

def to_jsii
  result = {}
  result.merge!({
    "columns" => @columns,
    "delimiter" => @delimiter,
    "quoteCharacter" => @quote_character,
    "source" => @source,
  })
  result.compact
end