Module: Releaseable::Loggly
- Defined in:
- lib/releaseable/loggly.rb
Class Method Summary collapse
Class Method Details
.search(domain, user, pass, query) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/releaseable/loggly.rb', line 6 def self.search domain, user, pass, query query = {:q => query} if query.is_a?(String) response = HTTP.get "http://#{domain}.loggly.com/api/search", user, pass, query.is_a?(Hash) ? query : {:q => query} parsed = JSON.parse(response.body) if parsed['data'] parsed['data'].map { |entry| JSON.parse(entry.delete('text')).merge(entry) } else parsed end end |