lib/logstash/filters/aggregate.rb
def create_timeout_event(aggregation_map, task_id)

    @logger.debug("Aggregate create_timeout_event call with task_id '#{task_id}'")

    event_to_yield = LogStash::Event.new(aggregation_map)

    if @timeout_task_id_field
      event_to_yield.set(@timeout_task_id_field, task_id)
    end

    LogStash::Util::Decorators.add_tags(@timeout_tags, event_to_yield, "filters/#{self.class.name}")


    # Call timeout code block if available
    if @timeout_code
      begin
        @timeout_codeblock.call(event_to_yield)
      rescue => exception
        @logger.error("Aggregate exception occurred",
                      :error => exception,
                      :timeout_code => @timeout_code,
                      :timeout_event_data => event_to_yield.to_hash_with_metadata)
        event_to_yield.tag("_aggregateexception")
        metric.increment(:timeout_code_errors)
      end
    end

    metric.increment(:pushed_events)

    return event_to_yield
  end
# Create a new event from the aggregation_map and the corresponding task_id
# This will create the event and
#  if @timeout_task_id_field is set, it will set the task_id on the timeout event
#  if @timeout_code is set, it will execute the timeout code on the created timeout event
# returns the newly created event
Create a new event from the aggregation_map and the corresponding task_id
This will create the event and
if @timeout_task_id_field is set, it will set the task_id on the timeout event
if @timeout_code is set, it will execute the timeout code on the created timeout event
returns the newly created event
Create a new event from the aggregation_map and the corresponding task_id This will create the event and if @timeout_task_id_field is set it will set the task_id on the timeout event if @timeout_code is set it will execute the timeout code on the created timeout event returns the newly created event
def create_timeout_event(aggregation_map, task_id)
    @logger.debug("Aggregate create_timeout_event call with task_id '#{task_id}'")
    event_to_yield = LogStash::Event.new(aggregation_map)
    if @timeout_task_id_field
      event_to_yield.set(@timeout_task_id_field, task_id)
    end
    LogStash::Util::Decorators.add_tags(@timeout_tags, event_to_yield, "filters/#{self.class.name}")
    if @timeout_code
      begin
        @timeout_codeblock.call(event_to_yield)
      rescue => exception
        @logger.error("Aggregate exception occurred",
                      :error => exception,
                      :timeout_code => @timeout_code,
                      :timeout_event_data => event_to_yield.to_hash_with_metadata)
        event_to_yield.tag("_aggregateexception")
        metric.increment(:timeout_code_errors)
      end
    end
    metric.increment(:pushed_events)
    return event_to_yield
  end
def create_timeout_event ( aggregation_map , task_id ) @logger . debug ( "Aggregate create_timeout_event call with task_id '#{task_id}'" ) event_to_yield = LogStash :: Event . new ( aggregation_map ) if @timeout_task_id_field event_to_yield . set ( @timeout_task_id_field , task_id ) end LogStash :: Util :: Decorators . add_tags ( @timeout_tags , event_to_yield , "filters/#{self.class.name}" ) if @timeout_code begin @timeout_codeblock . call ( event_to_yield ) rescue => exception @logger . error ( "Aggregate exception occurred" , :error => exception , :timeout_code => @timeout_code , :timeout_event_data => event_to_yield . to_hash_with_metadata ) event_to_yield . tag ( "_aggregateexception" ) metric . increment ( :timeout_code_errors ) end end metric . increment ( :pushed_events ) return event_to_yield end
Create a new event from the aggregation_map and the corresponding task_id
This will create the event and
if @timeout_task_id_field is set, it will set the task_id on the timeout event
if @timeout_code is set, it will execute the timeout code on the created timeout event
returns the newly created event
Create a new event from the aggregation_map and the corresponding task_id This will create the event and if @timeout_task_id_field is set it will set the task_id on the timeout event if @timeout_code is set it will execute the timeout code on the created timeout event returns the newly created event
# Call timeout code block if available
aggregation_map
task_id