Class: LogStash::Search::Result
- Inherits:
-
Object
- Object
- LogStash::Search::Result
- Defined in:
- lib/logstash/search/result.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
How long this query took, in seconds (or fractions of).
-
#error_message ⇒ Object
Error message, if any.
-
#events ⇒ Object
Array of LogStash::Event of results.
-
#offset ⇒ Object
Offset in search.
-
#total ⇒ Object
Total records matched by this query, regardless of offset/count in query.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(settings = {}) ⇒ Result
constructor
A new instance of Result.
- #to_json ⇒ Object
Constructor Details
#initialize(settings = {}) ⇒ Result
Returns a new instance of Result.
20 21 22 23 24 |
# File 'lib/logstash/search/result.rb', line 20 def initialize(settings={}) @events = [] @duration = nil @error_message = nil end |
Instance Attribute Details
#duration ⇒ Object
How long this query took, in seconds (or fractions of).
9 10 11 |
# File 'lib/logstash/search/result.rb', line 9 def duration @duration end |
#error_message ⇒ Object
Error message, if any.
18 19 20 |
# File 'lib/logstash/search/result.rb', line 18 def @error_message end |
#events ⇒ Object
Array of LogStash::Event of results
6 7 8 |
# File 'lib/logstash/search/result.rb', line 6 def events @events end |
#offset ⇒ Object
Offset in search
12 13 14 |
# File 'lib/logstash/search/result.rb', line 12 def offset @offset end |
#total ⇒ Object
Total records matched by this query, regardless of offset/count in query.
15 16 17 |
# File 'lib/logstash/search/result.rb', line 15 def total @total end |
Instance Method Details
#error? ⇒ Boolean
26 27 28 |
# File 'lib/logstash/search/result.rb', line 26 def error? return !@error_message.nil? end |
#to_json ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/logstash/search/result.rb', line 30 def to_json return { "events" => @events, "duration" => @duration, "offset" => @offset, "total" => @total, }.to_json end |