<?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 Combining and summing the results of two searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164232#M46639</link>
    <description>&lt;P&gt;Hi -&lt;/P&gt;

&lt;P&gt;I have two searches that have the same fields exactly but from different sources.&lt;/P&gt;

&lt;P&gt;I would like to join and sum the results and output&lt;/P&gt;

&lt;P&gt;The searches:&lt;BR /&gt;
index="atti" sourcetype="strongmail" source="/data1/strongmail/log/strongmail-retryfailed.log" mailingclass="smtpvhost1.yp.com"|stats count as NumberFailed by MailingId,Bouncetype &lt;/P&gt;

&lt;P&gt;MailingId, Bouncetype, NumberFailed&lt;BR /&gt;
12121,2004,2&lt;BR /&gt;
12058,3004,4&lt;/P&gt;

&lt;P&gt;index="atti" sourcetype="strongmail" source="/data1/strongmail/log/strongmail-failed.log"  mailingclass="smtpvhost1.yp.com" |stats count as NumberFailed by MailingId,Bouncetype &lt;/P&gt;

&lt;P&gt;MailingId, Bouncetype, NumberFailed&lt;BR /&gt;
12121,2004,4&lt;BR /&gt;
12058,3004,6&lt;/P&gt;

&lt;P&gt;They return exactly as you see the same columns, I want combine(Sum) the results and output:&lt;/P&gt;

&lt;P&gt;MailingId, Bouncetype, NumberFailed&lt;BR /&gt;
12121,2004,6&lt;BR /&gt;
12058,3004,10&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2015 00:05:21 GMT</pubDate>
    <dc:creator>rajadatta</dc:creator>
    <dc:date>2015-06-16T00:05:21Z</dc:date>
    <item>
      <title>Combining and summing the results of two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164232#M46639</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;

&lt;P&gt;I have two searches that have the same fields exactly but from different sources.&lt;/P&gt;

&lt;P&gt;I would like to join and sum the results and output&lt;/P&gt;

&lt;P&gt;The searches:&lt;BR /&gt;
index="atti" sourcetype="strongmail" source="/data1/strongmail/log/strongmail-retryfailed.log" mailingclass="smtpvhost1.yp.com"|stats count as NumberFailed by MailingId,Bouncetype &lt;/P&gt;

&lt;P&gt;MailingId, Bouncetype, NumberFailed&lt;BR /&gt;
12121,2004,2&lt;BR /&gt;
12058,3004,4&lt;/P&gt;

&lt;P&gt;index="atti" sourcetype="strongmail" source="/data1/strongmail/log/strongmail-failed.log"  mailingclass="smtpvhost1.yp.com" |stats count as NumberFailed by MailingId,Bouncetype &lt;/P&gt;

&lt;P&gt;MailingId, Bouncetype, NumberFailed&lt;BR /&gt;
12121,2004,4&lt;BR /&gt;
12058,3004,6&lt;/P&gt;

&lt;P&gt;They return exactly as you see the same columns, I want combine(Sum) the results and output:&lt;/P&gt;

&lt;P&gt;MailingId, Bouncetype, NumberFailed&lt;BR /&gt;
12121,2004,6&lt;BR /&gt;
12058,3004,10&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 00:05:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164232#M46639</guid>
      <dc:creator>rajadatta</dc:creator>
      <dc:date>2015-06-16T00:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Combining and summing the results of two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164233#M46640</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="atti" sourcetype="strongmail" mailingclass="smtpvhost1.yp.com" (source="/data1/strongmail/log/strongmail-retryfailed.log" OR source="/data1/strongmail/log/strongmail-failed.log") |stats count as NumberFailed by MailingId,Bouncetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2015 00:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164233#M46640</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-16T00:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Combining and summing the results of two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164234#M46641</link>
      <description>&lt;P&gt;Hi  rajadatta &lt;BR /&gt;
Try the following query :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    |set union [search index="atti" sourcetype="strongmail" source="/data1/strongmail/log/strongmail-retryfailed.log" mailingclass="smtpvhost1.yp.com"|stats count as NumberFailed by MailingId,Bouncetype  ] [search index="atti" sourcetype="strongmail" source="/data1/strongmail/log/strongmail-failed.log" mailingclass="smtpvhost1.yp.com" |stats count as NumberFailed by MailingId,Bouncetype ]|stats sum(NumberFailed) as total_NumberFailed 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2015 09:28:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164234#M46641</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-06-16T09:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Combining and summing the results of two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164235#M46642</link>
      <description>&lt;P&gt;Thanks this gives me the total failed as count.  I can use this as well for another report.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 17:44:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164235#M46642</guid>
      <dc:creator>rajadatta</dc:creator>
      <dc:date>2015-06-16T17:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Combining and summing the results of two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164236#M46643</link>
      <description>&lt;P&gt;Thanks this is what I needed.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 17:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164236#M46643</guid>
      <dc:creator>rajadatta</dc:creator>
      <dc:date>2015-06-16T17:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Combining and summing the results of two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164237#M46644</link>
      <description>&lt;P&gt;Thanks for the help.  I went with the first answer as it was what I was looking for.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 17:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-and-summing-the-results-of-two-searches/m-p/164237#M46644</guid>
      <dc:creator>rajadatta</dc:creator>
      <dc:date>2015-06-16T17:44:53Z</dc:date>
    </item>
  </channel>
</rss>

