Class: LogStash::Outputs::Xlsx
- Inherits:
-
Base
- Object
- Base
- LogStash::Outputs::Xlsx
- Defined in:
- lib/logstash/outputs/xlsx.rb
Overview
A null output. This is useful for testing logstash inputs and filters for performance.
Instance Method Summary collapse
Instance Method Details
#flush(path) ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/logstash/outputs/xlsx.rb', line 81 def flush(path) @files.each do |path, package| if(File.basename(path) == File.basename(path)) package.serialize(path) end end end |
#receive(event) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/logstash/outputs/xlsx.rb', line 58 def receive(event) @codec.encode(event) if event.include? "tags" and event["tags"].include?("eof") flush event['path'] end end |
#register ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/logstash/outputs/xlsx.rb', line 31 def register @files = {} @codec.on_event do |event| if @path path = event.sprintf(@path) else path = event["path"] end if event.is_a? LogStash::Event and @message_format output = event.sprintf(@message_format) else output = event["message"] end cells = output.split(/;/) wsname = event["wsname"] worksheet = get_worksheet(path, wsname) worksheet.add_row cells end end |