<?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: Group results by common value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193448#M55686</link>
    <description>&lt;P&gt;Beautiful solution. Thanks for providing. Found this independently 2 yrs after you posted it.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2016 20:40:07 GMT</pubDate>
    <dc:creator>bbsoc1</dc:creator>
    <dc:date>2016-04-22T20:40:07Z</dc:date>
    <item>
      <title>Group results by common value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193445#M55683</link>
      <description>&lt;P&gt;Alright. My current query looks something like this:&lt;/P&gt;

&lt;P&gt;sourcetype=email action=accept ip=127.0.0.1 | stats count(subject), dc(recipients) by ip, subject&lt;/P&gt;

&lt;P&gt;And this produces output like the following:&lt;/P&gt;

&lt;P&gt;ip         subject     count     dc(recipients)&lt;/P&gt;

&lt;P&gt;127.0.0.1  email1      10        10&lt;/P&gt;

&lt;P&gt;127.0.0.1  email2      5         2&lt;/P&gt;

&lt;P&gt;127.0.0.1  email3      1         1&lt;/P&gt;

&lt;P&gt;How would I query this instead so I can group those results together by IP so I'd be looking at a format like this?&lt;/P&gt;

&lt;P&gt;ip          subject     count     dc(recipients)&lt;/P&gt;

&lt;P&gt;127.0.0.1   email1      10        10&lt;/P&gt;

&lt;P&gt;email2      5         2&lt;/P&gt;

&lt;P&gt;email3      1         1&lt;/P&gt;

&lt;P&gt;I haven't figured out a query yet that will let me group by IP while still getting a count for each subject value, and a distinct count for the number of recipients for each subject value.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 21:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193445#M55683</guid>
      <dc:creator>dcarriger</dc:creator>
      <dc:date>2014-03-18T21:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Group results by common value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193446#M55684</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=email action=accept ip=127.0.0.1 | stats count(subject) as count, dc(recipients) as recipients by ip, subject | stats list(subject) as subject , list(count) as count, list(recipients) as recipients by ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Mar 2014 22:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193446#M55684</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-18T22:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Group results by common value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193447#M55685</link>
      <description>&lt;P&gt;Awesome! This does exactly what I need it to. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 22:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193447#M55685</guid>
      <dc:creator>dcarriger</dc:creator>
      <dc:date>2014-03-18T22:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Group results by common value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193448#M55686</link>
      <description>&lt;P&gt;Beautiful solution. Thanks for providing. Found this independently 2 yrs after you posted it.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 20:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-results-by-common-value/m-p/193448#M55686</guid>
      <dc:creator>bbsoc1</dc:creator>
      <dc:date>2016-04-22T20:40:07Z</dc:date>
    </item>
  </channel>
</rss>

