Class: CloudWatchLogsPoller::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_watch_logs_poller/event.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_stream_name, timestamp, message, ingestion_time, event_id) ⇒ Event

Returns a new instance of Event.



9
10
11
12
13
14
15
# File 'lib/cloud_watch_logs_poller/event.rb', line 9

def initialize(log_stream_name, timestamp, message, ingestion_time, event_id)
  @log_stream_name = log_stream_name
  @timestamp = timestamp
  @message = message
  @ingestion_time = ingestion_time
  @event_id = event_id
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



7
8
9
# File 'lib/cloud_watch_logs_poller/event.rb', line 7

def event_id
  @event_id
end

#ingestion_timeObject (readonly)

Returns the value of attribute ingestion_time.



6
7
8
# File 'lib/cloud_watch_logs_poller/event.rb', line 6

def ingestion_time
  @ingestion_time
end

#log_stream_nameObject (readonly)

Returns the value of attribute log_stream_name.



3
4
5
# File 'lib/cloud_watch_logs_poller/event.rb', line 3

def log_stream_name
  @log_stream_name
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/cloud_watch_logs_poller/event.rb', line 5

def message
  @message
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



4
5
6
# File 'lib/cloud_watch_logs_poller/event.rb', line 4

def timestamp
  @timestamp
end

Class Method Details

.convert_from_filtered_log_event(event) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/cloud_watch_logs_poller/event.rb', line 17

def self.convert_from_filtered_log_event(event)
  new(
    event.log_stream_name,
    event.timestamp,
    event.message,
    event.ingestion_time,
    event.event_id
  )
end