class YahooQueryParser
Public Class Methods
new()
click to toggle source
# File lib/logstash/filters/parsers/yahoo.rb, line 7 def initialize @re_url = /(?:[^\.]*\.)?search.yahoo\..*/ @re_query = /^\/search\?(?:[^&]*&)?p=(?<query>[^&#]*)/i end
Public Instance Methods
match(siteName)
click to toggle source
# File lib/logstash/filters/parsers/yahoo.rb, line 13 def match(siteName) return @re_url.match(siteName) end
parse(query)
click to toggle source
# File lib/logstash/filters/parsers/yahoo.rb, line 17 def parse(query) query = Utils.removeInvalidChars(query) m = @re_query.match(query) if m then return m["query"].tr("+", " ").split.join(" ") end end