<?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: Not getting top 50 values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124119#M33545</link>
    <description>&lt;P&gt;The pipeline from the first &lt;CODE&gt;stats&lt;/CODE&gt; onwards doesn't know or care about the &lt;CODE&gt;status&lt;/CODE&gt; field. As a result, searching for &lt;CODE&gt;status=4* OR status=5*&lt;/CODE&gt; will lead to the top 50 &lt;CODE&gt;uri&lt;/CODE&gt; values over all matching &lt;CODE&gt;status&lt;/CODE&gt; codes. As a consequence, the top &lt;CODE&gt;uri&lt;/CODE&gt; should have a higher count with the more broad &lt;CODE&gt;status&lt;/CODE&gt; filter than with &lt;CODE&gt;status=404&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2015 17:16:41 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-02-02T17:16:41Z</dc:date>
    <item>
      <title>Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124116#M33542</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to get top 50 404s by uri and the corresponding referers by their count.  For example, if uri1 is the top most  uri with 5k 404s and the top referer for that uri1 (which results in 404s) could be referer1 with count of 1000. &lt;/P&gt;

&lt;P&gt;I have used this search and it gives me count for uri and referers but i am not getting top 50 count.  I am getting less than 50. what is wrong in this query? any suggestions please.&lt;/P&gt;

&lt;P&gt;sourcetype=access_combined_wcookie  status=404 | top 50 uri | eval CNT=count | eval %=percent | join uri [search sourcetype=access_combined_wcookie  status=404 | top 50 uri referer | eval referer_count=count | eval referer_percent=percent ]  | table CNT,%,uri,referer, count | sort - CNT&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124116#M33542</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2020-09-28T18:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124117#M33543</link>
      <description>&lt;P&gt;The second query is computing the top 50 uri-referer combinations. It's not giving you the top referer for the top 50 uris.&lt;/P&gt;

&lt;P&gt;Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=access_combined_wcookie status=404 | stats count as ur_count by uri referer | eventstats sum(ur_count) as count by uri | sort 0 - ur_count | dedup uri | sort 0 - count | head 50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll get the count per uri in &lt;CODE&gt;count&lt;/CODE&gt; and the count for that top referer in &lt;CODE&gt;ur_count&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Feb 2015 13:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124117#M33543</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-02-01T13:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124118#M33544</link>
      <description>&lt;P&gt;Hi. Thanks for the reply. This is much simpler version. One question - In the status, instead of status=404 i am have (status=4* OR status=5*). So when it uses head 50, does it use first 50 by their count? I am getting very less number of results when i am doing this way. But when i just use status=404, looks like it gives me correct numbers. &lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 12:46:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124118#M33544</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2015-02-02T12:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124119#M33545</link>
      <description>&lt;P&gt;The pipeline from the first &lt;CODE&gt;stats&lt;/CODE&gt; onwards doesn't know or care about the &lt;CODE&gt;status&lt;/CODE&gt; field. As a result, searching for &lt;CODE&gt;status=4* OR status=5*&lt;/CODE&gt; will lead to the top 50 &lt;CODE&gt;uri&lt;/CODE&gt; values over all matching &lt;CODE&gt;status&lt;/CODE&gt; codes. As a consequence, the top &lt;CODE&gt;uri&lt;/CODE&gt; should have a higher count with the more broad &lt;CODE&gt;status&lt;/CODE&gt; filter than with &lt;CODE&gt;status=404&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 17:16:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124119#M33545</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-02-02T17:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124120#M33546</link>
      <description>&lt;P&gt;That is what i was expecting but surprisingly the counts are very less. i can send a screenshot of it if you would like to. &lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 17:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124120#M33546</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2015-02-02T17:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124121#M33547</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;P&gt;Updated Search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=_internal sourcetype=*web_access (status=4* OR status=5*) | stats count as ur_count by status, uri ,referer | eventstats sum(ur_count) as count by status, uri | sort 0 - status, count | dedup status, uri | sort - status uri count | streamstats count as rank by status, uri | where rank &amp;lt; 51 | sort  status -count| fields - rank ur_count | table count status uri referer
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Feb 2015 18:15:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124121#M33547</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-02-02T18:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124122#M33548</link>
      <description>&lt;P&gt;That did not work either...it is giving count as 1 for each of them..&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 21:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124122#M33548</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2015-02-02T21:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting top 50 values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124123#M33549</link>
      <description>&lt;P&gt;Try the updated search.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 22:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-top-50-values/m-p/124123#M33549</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-02-02T22:06:55Z</dc:date>
    </item>
  </channel>
</rss>

