class LogExtractor::Extract
Public Instance Methods
call(&block)
click to toggle source
# File lib/log_extractor/extract.rb, line 7 def call(&block) @response = search.response while raw_hits.any? raw_hits.each { |raw_hit| parse_hit(raw_hit, &block) } @response = search.scroll end end
Private Instance Methods
parse_hit(raw_hit) { |hit| ... }
click to toggle source
# File lib/log_extractor/extract.rb, line 21 def parse_hit(raw_hit) hit = Hit.new(source: raw_hit["_source"]) yield hit end
raw_hits()
click to toggle source
# File lib/log_extractor/extract.rb, line 17 def raw_hits @response["hits"]["hits"] end
search()
click to toggle source
# File lib/log_extractor/extract.rb, line 26 def search @search ||= Search.new(query: query, period: period) end