Sha256: fa2261407c80ea95f28cd8dea2aebfccc1c53011b939ceffea7a19759343b9bf

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 Bytes

Contents

class FluQ::Format::Tsv < FluQ::Format::Lines

  # @see FluQ::Format::Base.to_event
  def self.to_event(raw)
    timestamp, json = raw.split("\t")

    case hash = MultiJson.load(json)
    when Hash
      FluQ::Event.new hash, timestamp
    else
      logger.warn "buffer contained invalid event #{hash.inspect}"
      nil
    end
  rescue MultiJson::LoadError, ArgumentError
    logger.warn "buffer contained invalid line #{raw.inspect}"
    nil
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluq-0.8.1 lib/fluq/format/tsv.rb
fluq-0.8.0 lib/fluq/format/tsv.rb