Class: LogEvents

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/dto/logEvents.rb

Overview

Copyright © 2021, 2024 Oracle and/or its affiliates. The Universal Permissive License (UPL), Version 1.0 as shown at oss.oracle.com/licenses/upl/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lrpe_key, fluentd_records) ⇒ LogEvents

Returns a new instance of LogEvents.



6
7
8
9
10
11
# File 'lib/fluent/dto/logEvents.rb', line 6

def initialize(lrpe_key, fluentd_records)
  @metadata, @entityId, @entityType, @logSourceName, @logPath, @timezone = lrpe_key
  @logRecords = fluentd_records.map{ |record|
      record['message']
  }
end

Instance Attribute Details

#entityIdObject

Returns the value of attribute entityId.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def entityId
  @entityId
end

#entityTypeObject

Returns the value of attribute entityType.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def entityType
  @entityType
end

#logPathObject

Returns the value of attribute logPath.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def logPath
  @logPath
end

#logRecordsObject

Returns the value of attribute logRecords.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def logRecords
  @logRecords
end

#logSourceNameObject

Returns the value of attribute logSourceName.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def logSourceName
  @logSourceName
end

#metadataObject

Returns the value of attribute metadata.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def 
  @metadata
end

#timezoneObject

Returns the value of attribute timezone.



5
6
7
# File 'lib/fluent/dto/logEvents.rb', line 5

def timezone
  @timezone
end

Instance Method Details

#to_hashObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fluent/dto/logEvents.rb', line 13

def to_hash
  {
    metadata: @metadata,
    entityId: @entityId,
    entityType: @entityType,
    logSourceName: @logSourceName,
    logPath: @logPath,
    logRecords: @logRecords,
    timezone:@timezone
  }.compact
end