Method: LogStash::Outputs::CloudWatch#receive

Defined in:
lib/logstash/outputs/cloudwatch.rb

#receive(event) ⇒ Object



179
180
181
182
183
184
185
186
187
188
189
# File 'lib/logstash/outputs/cloudwatch.rb', line 179

def receive(event)
  return unless (event.get(@field_metricname) || @metricname)

  if (@event_queue.length >= @event_queue.max)
    do_publish
    @logger.warn("Posted to AWS CloudWatch ahead of schedule.  If you see this often, consider increasing the cloudwatch queue_size option.")
  end

  @logger.debug? && @logger.debug("Queueing event", :event => event.to_hash)
  @event_queue << event
end