Class: ApacheCrunch::RawValueFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/element_value_fetcher.rb

Overview

Returns the value of an element that was captured straight from the log.

Instance Method Summary collapse

Instance Method Details

#fetch(entry, element_name) ⇒ Object

Returns the value of the Element with the given name in the given Entry.

Only works for elements based on tokens that we parsed directly into the Entry. If no matching element is found, we return nil.



36
37
38
39
40
# File 'lib/element_value_fetcher.rb', line 36

def fetch(entry, element_name)
    element = entry.captured_elements[element_name]
    return nil if element.nil?
    element.value
end