Skip to content

Instantly share code, notes, and snippets.

@atopal
Created October 26, 2012 14:24
Show Gist options
  • Save atopal/3959120 to your computer and use it in GitHub Desktop.
Save atopal/3959120 to your computer and use it in GitHub Desktop.
Number of searches for all
select ds, count(*) as searches
FROM research_logs
WHERE
ds = '${hiveconf:check_date}'
AND `domain`='support.mozilla.com'
AND ip_address != 'NULL' AND http_version = 200 AND request_type = 'GET'
AND
(parse_url(concat('http://a.com',request_url),'PATH') RLIKE '\\/..-..\/search\$'
OR parse_url(concat('http://a.com',request_url),'PATH') RLIKE '\\/..\/search\$'
)
AND parse_url(concat('http://a.com',request_url),'QUERY','a') IS NULL
AND parse_url(concat('http://a.com',request_url),'QUERY','page') IS NULL
AND parse_url(concat('http://a.com',request_url),'QUERY','format') IS NULL
AND user_agent NOT LIKE '%bot%'
AND user_agent NOT LIKE '%Netsparker%'
group by ds order by ds;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment