Methods

Class/Module Index [+]

Quicksearch

Fluent::MonitorAgentInput::LTSVMonitorServlet

Public Instance Methods

process(req, res) click to toggle source
# File lib/fluent/plugin/in_monitor_agent.rb, line 124
def process(req, res)
  list, opts = build_object(req, res)
  return unless list

  normalized = JSON.parse(list.to_json)

  text = ''

  normalized.map {|hash|
    row = []
    hash.each_pair {|k,v|
      unless v.is_a?(Hash) || v.is_a?(Array)
        row << "#{k}:#{v}"
      end
    }
    text << row.join("\t") << "\n"
  }

  [200, {'Content-Type'=>'text/plain'}, text]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.