<?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: Question regarding grouping of results into a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108908#M28389</link>
    <description>&lt;P&gt;Thanks, this is working wonderfully.&lt;BR /&gt;
I was wondering though, is there a way to only show the app name for the first entry of each section of IPs/bytes? This would be preferred for presentation.&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2011 12:57:20 GMT</pubDate>
    <dc:creator>aputz</dc:creator>
    <dc:date>2011-05-26T12:57:20Z</dc:date>
    <item>
      <title>Question regarding grouping of results into a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108906#M28387</link>
      <description>&lt;P&gt;So I have events which have the following fields that I would like to sort by:&lt;/P&gt;

&lt;P&gt;app, dst_ip, bytes&lt;/P&gt;

&lt;P&gt;Preferably I would want to display them in a table such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;web-browsing   I'M.A.DST.IP          1571453
               I'M.A.DST.IP            71453
               I'M.A.DST.IP             1453
skype          I'M.A.DST.IP          1412345
gmail-base     I'M.A.DST.IP          1012345
               I'M.A.DST.IP           212345
ssl            I'M.A.DST.IP           612345
               I'M.A.DST.IP           123456
               I'M.A.DST.IP            12345
               I'M.A.DST.IP             1234
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The sort function would be preferably be having these apps sorted via "-bytes" but also showing a breakout of associated dst_ips and their respective bytes count under each app (again sorted via -bytes). I am hoping this is possible via the search language whether it is with table or any other data formatting command. I recall stumbling across a grouping command before and I can't seem to find it again.&lt;BR /&gt;
Thank you for any help/assistance on this.&lt;/P&gt;

&lt;P&gt;Sincerely,&lt;/P&gt;

&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2011 19:19:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108906#M28387</guid>
      <dc:creator>aputz</dc:creator>
      <dc:date>2011-05-25T19:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding grouping of results into a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108907#M28388</link>
      <description>&lt;P&gt;It's the &lt;CODE&gt;stats&lt;/CODE&gt; command you're looking for.  stats can perform any number of statistical operations, and it can run them for each value of a single field, or for each unique combination of multiple fields.   In your case I think you want:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | stats sum(bytes) as bytes by app, dst_ip | sort - app bytes 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that I'm doing a double sort with the &lt;CODE&gt;sort&lt;/CODE&gt; command, to give you the primary and secondary sorting that you're looking for.  &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Stats"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Stats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Sort"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2011 19:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108907#M28388</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-05-25T19:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding grouping of results into a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108908#M28389</link>
      <description>&lt;P&gt;Thanks, this is working wonderfully.&lt;BR /&gt;
I was wondering though, is there a way to only show the app name for the first entry of each section of IPs/bytes? This would be preferred for presentation.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 12:57:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108908#M28389</guid>
      <dc:creator>aputz</dc:creator>
      <dc:date>2011-05-26T12:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding grouping of results into a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108909#M28390</link>
      <description>&lt;P&gt;Sure. You can tack this onto the end: &lt;/P&gt;

&lt;P&gt;" | streamstats current=f last(app) as previousApp | eval app=if(match(app,previousApp),"",app)| fields - previousApp"&lt;/P&gt;

&lt;P&gt;However note that if your table is split across multiple pages this could get quite confusing for your users.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 16:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108909#M28390</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-05-26T16:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding grouping of results into a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108910#M28391</link>
      <description>&lt;P&gt;That is just what I was looking for. I agree it will potentially make it difficult if it is presented across multiple pages, I appreciate having the options for layout though.&lt;/P&gt;

&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 16:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108910#M28391</guid>
      <dc:creator>aputz</dc:creator>
      <dc:date>2011-05-26T16:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding grouping of results into a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108911#M28392</link>
      <description>&lt;P&gt;Nice hack.. But I wish Splunk brings a simple XML "mergecell" table option&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2014 23:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-regarding-grouping-of-results-into-a-table/m-p/108911#M28392</guid>
      <dc:creator>koprai</dc:creator>
      <dc:date>2014-12-19T23:34:26Z</dc:date>
    </item>
  </channel>
</rss>

