Class: Fluent::Plugin::GroongaLogParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/fluent/plugin/parser_groonga_log.rb

Instance Method Summary collapse

Constructor Details

#initializeGroongaLogParser

Returns a new instance of GroongaLogParser.



24
25
26
27
28
# File 'lib/fluent/plugin/parser_groonga_log.rb', line 24

def initialize
  super
  @mutex = Mutex.new
  @parser = GroongaLog::Parser.new
end

Instance Method Details

#configure(conf) ⇒ Object



30
31
32
# File 'lib/fluent/plugin/parser_groonga_log.rb', line 30

def configure(conf)
  super
end

#parse(text) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/fluent/plugin/parser_groonga_log.rb', line 34

def parse(text)
  @parser.parse(text) do |statistic|
    event_time = Fluent::EventTime.from_time(statistic.timestamp)
    record = {}
    statistic.each_pair do |member, value|
      record[member.to_s] = value
    end
    yield event_time, record
  end
end