Class: Lstash::CLI

Inherits:
CLIBase show all
Defined in:
lib/lstash/cli.rb

Instance Method Summary collapse

Methods inherited from CLIBase

shared_options

Instance Method Details

#count(query_string) ⇒ Object



56
57
58
59
60
61
# File 'lib/lstash/cli.rb', line 56

def count(query_string)
  run_command(query_string) do |es_client, query|
    count = Lstash::Client.new(es_client, options).count(query)
    puts count
  end
end

#grep(query_string) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/lstash/cli.rb', line 38

def grep(query_string)
  run_command(query_string) do |es_client, query|
    Lstash::Client.new(es_client, options).grep(query) do |message|
      puts message
    end
  end
end

#versionObject



65
66
67
# File 'lib/lstash/cli.rb', line 65

def version
  puts Lstash::VERSION
end