Sha256: 5b37348245fa70a0ae1129fd6465f15c57f51328bc448523ec97d29a979bf3b9

Contents?: true

Size: 772 Bytes

Versions: 16

Compression:

Stored size: 772 Bytes

Contents

# encoding: utf-8
require "logstash/inputs/beats"

module LogStash::Inputs::BeatsSupport
  # Use the new callback based approch instead of using blocks
  # so we can retain some context of the execution, and make it easier to test
  class CodecCallbackListener
    attr_accessor :data
    # The path acts as the `stream_identity`, 
    # usefull when the clients is reading multiples files
    attr_accessor :path

    def initialize(data, hash, path, transformer, queue)
      @data = data
      @hash = hash 
      @path = path
      @queue = queue
      @transformer = transformer
    end

    def process_event(event)
      @transformer.transform(event, @hash)
      raise LogStash::Inputs::Beats::InsertingToQueueTakeTooLong if !@queue.offer(event)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
logstash-input-beats-3.0.4 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.9 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-3.0.3 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-3.0.2 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-3.0.1 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-3.0.0 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.8 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.7 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.5 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.3 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.2 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.2.0 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.1.4 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.1.3 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.1.2 lib/logstash/inputs/beats_support/codec_callback_listener.rb
logstash-input-beats-2.1.1 lib/logstash/inputs/beats_support/codec_callback_listener.rb