Class: LogStash::Codecs::Excel
- Inherits:
-
Base
- Object
- Base
- LogStash::Codecs::Excel
- Defined in:
- lib/logstash/codecs/excel.rb
Overview
The “xls” codec is mainly used for xls input
Instance Method Summary collapse
Instance Method Details
#decode(data) {|event| ... } ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/logstash/codecs/excel.rb', line 24 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) ⇒ Object
40 41 42 |
# File 'lib/logstash/codecs/excel.rb', line 40 def encode(event) @on_event.call data end |
#register ⇒ Object
18 19 20 21 |
# File 'lib/logstash/codecs/excel.rb', line 18 def register @converter = LogStash::Util::Charset.new(@charset) @converter.logger = @logger end |