Module: LogstashCli::Command

Includes:
Count, Grep, Tail
Included in:
CLI
Defined in:
lib/logstash-cli/command.rb

Instance Method Summary collapse

Methods included from Count

#_count

Methods included from Tail

#_tail

Methods included from Grep

#_grep, indexes_from_interval, parse_time_range

Instance Method Details

#_format(result, options) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/logstash-cli/command.rb', line 11

def _format(result,options)
  output = case options[:format]
             when 'csv' then result.to_csv({:col_sep => options[:delim]})
             when 'json' then result.to_json
             when 'plain' then result.join(options[:delim])
           end
  return output
end