class LogStash::Codecs::Excel

The “xls” codec is mainly used for xls input

Public Instance Methods

decode(data) { |event| ... } click to toggle source
# File lib/logstash/codecs/excel.rb, line 26
def decode(data)
  if data.is_a? Hash
    line = ""
    data[:row].each do |col|
      line << "#{col};"
    end

    event = LogStash::Event.new("message" => @converter.convert(line.rstrip))
    event.tag("eof") if data[:eof]
    event["wsname"] = data[:wsname]
  end

  yield event
end
encode(event) click to toggle source
# File lib/logstash/codecs/excel.rb, line 42
def encode(event)
  @on_event.call data
end
register() click to toggle source
# File lib/logstash/codecs/excel.rb, line 20
def register
  @converter = LogStash::Util::Charset.new(@charset)
  @converter.logger = @logger
end