This processor interprets a stats log.
Create a stats log interpreter.
# File lib/sawmill/entry_processor/interpret_stats.rb, line 49 def initialize(opts_={}, &block_) @handler = opts_[:handler] || block_ || method(:handle_data) end
# File lib/sawmill/entry_processor/interpret_stats.rb, line 69 def finish @handler.call(nil) end
# File lib/sawmill/entry_processor/interpret_stats.rb, line 64 def handle_data(data_) true end
# File lib/sawmill/entry_processor/interpret_stats.rb, line 54 def message(entry_) data_ = ::JSON.parse(entry_.message) rescue nil if data_.is_a?(::Hash) @handler.call(data_) else nil end end