<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: count query - how to combine with a count on uniqu URLs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/count-query-how-to-combine-with-a-count-on-uniqu-URLs/m-p/52689#M12820</link>
    <description>&lt;P&gt;assuming your URL's are already being extracted you should be able to do it the following way.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=hwa_other source=/var/tomcat/servers/HAP01/logs/tomcat_access*.log "dealswidget" OR "hotelquerywidget" | rex "(?&amp;lt;myword&amp;gt;dealswidget|hotelquerywidget)" | stats dc(yoururlfield) as uniqueurls by myword
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Aug 2011 12:41:33 GMT</pubDate>
    <dc:creator>RicoSuave</dc:creator>
    <dc:date>2011-08-03T12:41:33Z</dc:date>
    <item>
      <title>count query - how to combine with a count on uniqu URLs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-query-how-to-combine-with-a-count-on-uniqu-URLs/m-p/52688#M12819</link>
      <description>&lt;P&gt;Hi. I have a query that returns a number count based on the occurence of 2 keywords:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=hwa_other source=/var/tomcat/servers/HAP01/logs/tomcat_access*.log "dealswidget" OR "hotelquerywidget" 
| rex "(?&amp;lt;myword&amp;gt;dealswidget|hotelquerywidget)"
| stats count by myword
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results are 2 counts:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1   dealswidget 9847
2   hotelquerywidget 88826
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After this i'd like a count on unique URLs. The log lines look like:&lt;BR /&gt;
(A typical URL is in the log line below and always in that position)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10.186.198.6 - - [29/Jul/2011:00:03:08 -0500] "GET /js/lib/jquery-1.5.js HTTP/1.0" 200 211978 "http://partners.hotels.com/hotelquerywidget/1/1/HCOM_ES-es_ES/hotelquerywidget.html" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30" "5DC1789408E34ECF1A8F25E521617E9D.ut03hap01"

10.186.198.6 - - [29/Jul/2011:00:09:04 -0500] "GET /styles/widget/hcom.external.common.css HTTP/1.1" 200 4255 "http://partners.hotels.com/dealswidget/1/2/1633826/HCOM_NO-no_NO/widget.html" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30" "3EDEC4AAE25F8C92260C2132409F54BC.ut03hap01"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be appreciated. &lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 09:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-query-how-to-combine-with-a-count-on-uniqu-URLs/m-p/52688#M12819</guid>
      <dc:creator>nishil</dc:creator>
      <dc:date>2011-08-03T09:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: count query - how to combine with a count on uniqu URLs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-query-how-to-combine-with-a-count-on-uniqu-URLs/m-p/52689#M12820</link>
      <description>&lt;P&gt;assuming your URL's are already being extracted you should be able to do it the following way.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=hwa_other source=/var/tomcat/servers/HAP01/logs/tomcat_access*.log "dealswidget" OR "hotelquerywidget" | rex "(?&amp;lt;myword&amp;gt;dealswidget|hotelquerywidget)" | stats dc(yoururlfield) as uniqueurls by myword
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Aug 2011 12:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-query-how-to-combine-with-a-count-on-uniqu-URLs/m-p/52689#M12820</guid>
      <dc:creator>RicoSuave</dc:creator>
      <dc:date>2011-08-03T12:41:33Z</dc:date>
    </item>
  </channel>
</rss>

