<?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 Pivot with top distinct values? Maybe a nested pivot? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/140999#M3147</link>
    <description>&lt;P&gt;I have a pivot set up as follows:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Data source &lt;CODE&gt;myfirewall&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Rows split on &lt;CODE&gt;source_ip&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Columns include &lt;CODE&gt;bytes_downloaded&lt;/CODE&gt; and &lt;CODE&gt;outside_hosts&lt;/CODE&gt;. &lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I'd like to only return the top say 5 or 10 &lt;CODE&gt;outside_hosts&lt;/CODE&gt; along with their associated &lt;CODE&gt;bytes_downloaded&lt;/CODE&gt;. How can I do so? I'm guessing it is somewhere in the manual but I'm getting lost in the terminology. &lt;/P&gt;

&lt;P&gt;EDIT to answer @mattness:&lt;/P&gt;

&lt;P&gt;Yes, I'm hoping to do this through the GUI. I've written nested searches and the like before and I can go back to doing so here if needed. Hoping not though. I have dozens of varying searches similar to this and it would be &lt;EM&gt;extremely&lt;/EM&gt; useful to allow some of my other coworkers to make their own. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;outside_hosts&lt;/CODE&gt; is a string field containing a domain name or an IP address. &lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;source_ip&lt;/CODE&gt; is a string field containing a source IP address (inside the firewall)&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;bytes_downloaded&lt;/CODE&gt; is a numeric field representing the number of bytes downloaded in a given session&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Each &lt;CODE&gt;source_ip&lt;/CODE&gt; can map to one or more &lt;CODE&gt;outside_hosts&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;What I need to do is make a chart of the top 10 &lt;CODE&gt;source_ip&lt;/CODE&gt; entries based on their sum(&lt;CODE&gt;bytes_downloaded&lt;/CODE&gt;). Once that is completed to make the results readable I need a way to only show the top 20 &lt;CODE&gt;outside_hosts&lt;/CODE&gt; associated with that given &lt;CODE&gt;source_ip&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Using pseudocode for the last bit of logic: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;top(sum(`bytes_downloaded` split by `outside_hosts`) ) limit 20. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Feb 2014 20:46:45 GMT</pubDate>
    <dc:creator>timbCFCA</dc:creator>
    <dc:date>2014-02-06T20:46:45Z</dc:date>
    <item>
      <title>Pivot with top distinct values? Maybe a nested pivot?</title>
      <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/140999#M3147</link>
      <description>&lt;P&gt;I have a pivot set up as follows:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Data source &lt;CODE&gt;myfirewall&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Rows split on &lt;CODE&gt;source_ip&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Columns include &lt;CODE&gt;bytes_downloaded&lt;/CODE&gt; and &lt;CODE&gt;outside_hosts&lt;/CODE&gt;. &lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I'd like to only return the top say 5 or 10 &lt;CODE&gt;outside_hosts&lt;/CODE&gt; along with their associated &lt;CODE&gt;bytes_downloaded&lt;/CODE&gt;. How can I do so? I'm guessing it is somewhere in the manual but I'm getting lost in the terminology. &lt;/P&gt;

&lt;P&gt;EDIT to answer @mattness:&lt;/P&gt;

&lt;P&gt;Yes, I'm hoping to do this through the GUI. I've written nested searches and the like before and I can go back to doing so here if needed. Hoping not though. I have dozens of varying searches similar to this and it would be &lt;EM&gt;extremely&lt;/EM&gt; useful to allow some of my other coworkers to make their own. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;outside_hosts&lt;/CODE&gt; is a string field containing a domain name or an IP address. &lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;source_ip&lt;/CODE&gt; is a string field containing a source IP address (inside the firewall)&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;bytes_downloaded&lt;/CODE&gt; is a numeric field representing the number of bytes downloaded in a given session&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Each &lt;CODE&gt;source_ip&lt;/CODE&gt; can map to one or more &lt;CODE&gt;outside_hosts&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;What I need to do is make a chart of the top 10 &lt;CODE&gt;source_ip&lt;/CODE&gt; entries based on their sum(&lt;CODE&gt;bytes_downloaded&lt;/CODE&gt;). Once that is completed to make the results readable I need a way to only show the top 20 &lt;CODE&gt;outside_hosts&lt;/CODE&gt; associated with that given &lt;CODE&gt;source_ip&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Using pseudocode for the last bit of logic: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;top(sum(`bytes_downloaded` split by `outside_hosts`) ) limit 20. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2014 20:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/140999#M3147</guid>
      <dc:creator>timbCFCA</dc:creator>
      <dc:date>2014-02-06T20:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot with top distinct values? Maybe a nested pivot?</title>
      <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141000#M3148</link>
      <description>&lt;P&gt;Ok, I'm a bit unclear about a few things:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;How have gotten your column fields into the pivot table--are they &lt;STRONG&gt;Split Row&lt;/STRONG&gt; elements or &lt;STRONG&gt;Column Value&lt;/STRONG&gt; elements?&lt;/LI&gt;
&lt;LI&gt;What is the nature of the &lt;CODE&gt;column_hosts&lt;/CODE&gt; field? Is it a string type field? Or is it a numeric field--a count of hosts, perhaps? &lt;/LI&gt;
&lt;LI&gt;Does each &lt;CODE&gt;source_ip&lt;/CODE&gt; value correspond to a distinct/different &lt;CODE&gt;outside_hosts&lt;/CODE&gt; value? If the answer to that last question is 'no' you may want to consider making &lt;CODE&gt;outside_hosts&lt;/CODE&gt; the first &lt;STRONG&gt;Split Row&lt;/STRONG&gt; element, and move &lt;CODE&gt;source_ip&lt;/CODE&gt; to second place.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;In any case, here's a guess at a solution. Note that this assumes you're using the Pivot Builder interface, not the &lt;CODE&gt;pivot&lt;/CODE&gt; command.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Add &lt;CODE&gt;outside_hosts&lt;/CODE&gt; as a second &lt;STRONG&gt;Split Row&lt;/STRONG&gt; element. &lt;/LI&gt;
&lt;LI&gt;Set up &lt;CODE&gt;bytes_downloaded&lt;/CODE&gt; as a &lt;STRONG&gt;Column Value&lt;/STRONG&gt; element. When you do this, make sure &lt;STRONG&gt;Value&lt;/STRONG&gt; is set to &lt;EM&gt;Sum&lt;/EM&gt;. The resulting column will be labeled &lt;STRONG&gt;Sum of Bytes_Downloaded&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Now create a second &lt;STRONG&gt;Filter&lt;/STRONG&gt; element. Select &lt;CODE&gt;outside_hosts&lt;/CODE&gt; as the attribute. &lt;STRONG&gt;Filter Type:&lt;/STRONG&gt; &lt;EM&gt;Limit&lt;/EM&gt;. &lt;STRONG&gt;Limit By&lt;/STRONG&gt;: &lt;CODE&gt;bytes_downloaded&lt;/CODE&gt;. &lt;STRONG&gt;Limit&lt;/STRONG&gt;: &lt;EM&gt;Highest 10 sums&lt;/EM&gt;. &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;This should give you a table that shows the highest 10 outside hosts by sum of bytes downloaded. You can click the top of the &lt;EM&gt;Sum of bytes_downloaded&lt;/EM&gt; column to sort it from highest to lowest.&lt;/P&gt;

&lt;P&gt;If this doesn't work for you, I probably need answers to the questions I asked at the top of my reply.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2014 22:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141000#M3148</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2014-02-06T22:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot with top distinct values? Maybe a nested pivot?</title>
      <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141001#M3149</link>
      <description>&lt;P&gt;Thanks. I've updated my question with (I think) all the relevant answers to your questions. I'm thinking that using a second filter here would apply at the top level, not nested within a first set of criteria.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 14:34:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141001#M3149</guid>
      <dc:creator>timbCFCA</dc:creator>
      <dc:date>2014-02-07T14:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot with top distinct values? Maybe a nested pivot?</title>
      <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141002#M3150</link>
      <description>&lt;P&gt;Ok, the second search wasn't part of the original scenario, so that complicates things, as does the fact that each &lt;CODE&gt;source_ip&lt;/CODE&gt; can have multiple &lt;CODE&gt;outside_hosts&lt;/CODE&gt;. The procedure I outlined should work for the first search, but I don't know at the moment if there's an easy way to fulfill the second "to make results readable" search. You say that you need a way to "only show the top 20 &lt;CODE&gt;outside_hosts&lt;/CODE&gt; associated with that given &lt;CODE&gt;source_ip&lt;/CODE&gt;." Did you mean to say "&lt;STRONG&gt;a&lt;/STRONG&gt; given &lt;CODE&gt;source_ip&lt;/CODE&gt;? " If not, how do you arrive at "that" &lt;CODE&gt;source_ip&lt;/CODE&gt; value?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 22:33:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141002#M3150</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2014-02-07T22:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot with top distinct values? Maybe a nested pivot?</title>
      <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141003#M3151</link>
      <description>&lt;P&gt;You could set up a third filter (after the time range, and the "Highest 10 Sums" filter) that matches a selected &lt;CODE&gt;source_ip&lt;/CODE&gt; value. But it will only return values that are already in the first top 10 list--you won't get 20 values, in other words.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2014 22:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141003#M3151</guid>
      <dc:creator>mattness</dc:creator>
      <dc:date>2014-02-07T22:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot with top distinct values? Maybe a nested pivot?</title>
      <link>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141004#M3152</link>
      <description>&lt;P&gt;Thanks @mattness. I figured that the nested searching might be beyond the pivot GUI at current. If that isn't already on the Splunk roadmap and hopefully close it really aught to be. Half of my searches are set up this way and a way to allow nesting from the pivot interface (as well as cross reference data sources easily) would both be absolutely killer features.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2014 16:34:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Pivot-with-top-distinct-values-Maybe-a-nested-pivot/m-p/141004#M3152</guid>
      <dc:creator>timbCFCA</dc:creator>
      <dc:date>2014-02-10T16:34:56Z</dc:date>
    </item>
  </channel>
</rss>

