<?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: How to compare two search results to produce unique results within a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354221#M163169</link>
    <description>&lt;P&gt;It sounds like this comment contained the solution.  You might consider converting it to an answer (or editing your answer to include it), so @TDR57 can accept it.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2018 14:19:15 GMT</pubDate>
    <dc:creator>micahkemp</dc:creator>
    <dc:date>2018-02-05T14:19:15Z</dc:date>
    <item>
      <title>How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354212#M163160</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I run a search which produces a list of users that have logged an incident ticket within our fault system. I then run another search and append this to the first search which produces users that incident tickets have been closed as a user error. I then generate a table that has both results in it..&lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;P&gt;Username   good tickets  Bad tickets&lt;BR /&gt;
Joe                      5&lt;BR /&gt;&lt;BR /&gt;
Harry                  6                2&lt;BR /&gt;
John                    4                1&lt;BR /&gt;
Mary                    6&lt;/P&gt;

&lt;P&gt;Expected Output would only have both Joe and Mary in final table&lt;/P&gt;

&lt;P&gt;Example&lt;BR /&gt;
Username   good tickets  Bad tickets&lt;BR /&gt;
Joe                      5&lt;BR /&gt;&lt;BR /&gt;
Mary                    6&lt;/P&gt;

&lt;P&gt;can someone please help&lt;/P&gt;

&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 05:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354212#M163160</guid>
      <dc:creator>TDR57</dc:creator>
      <dc:date>2018-02-02T05:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354213#M163161</link>
      <description>&lt;P&gt;try like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;last table containing Username, good tickets Bad tickets&amp;gt;|fillnull|where 'Bad tickets' = 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 05:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354213#M163161</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-02T05:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354214#M163162</link>
      <description>&lt;P&gt;Sorry I should have mentioned that they are on two different lines&lt;/P&gt;

&lt;P&gt;Username good tickets Bad tickets&lt;BR /&gt;
Joe 5 &lt;BR /&gt;
Harry 6 &lt;BR /&gt;
Harry                                  2&lt;BR /&gt;&lt;BR /&gt;
John 4 &lt;BR /&gt;
John                                     1&lt;BR /&gt;&lt;BR /&gt;
Mary  6&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 05:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354214#M163162</guid>
      <dc:creator>TDR57</dc:creator>
      <dc:date>2018-02-02T05:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354215#M163163</link>
      <description>&lt;P&gt;not sure why you have used append instead you can use join to get on same line..&lt;BR /&gt;
if you could share your query with output (mask any important data) will help to understand better...&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 05:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354215#M163163</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-02T05:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354216#M163164</link>
      <description>&lt;P&gt;index=itam sourcetype=itam_inc_xml &lt;BR /&gt;
| search (product_name="prod name" OR product_name="prod name2") AND service_type="User*" AND status="Closed" OR status="Resolved" &lt;BR /&gt;
| stats latest(product_name) as product_name, latest(login_id) as login_id, latest(resolution_category_tier_2) as All_res_cat_2 by incident_number&lt;BR /&gt;
| lookup userid_lookup.csv impacted_Userid as login_id OUTPUTNEW impacted_Name impacted_Company impacted_street_address &lt;BR /&gt;
| stats count(incident_number) as ALL_count by impacted_Name, impacted_Company, impacted_street_address &lt;/P&gt;

&lt;P&gt;| join impacted_Name type=outer  [search (product_name="prod name" OR product_name="prod name2") AND service_type="User*" AND status="Closed" OR status="Resolved" AND resolution_category_tier_2="Process" OR resolution_category_tier_2="Training"&lt;BR /&gt;&lt;BR /&gt;
| stats latest(product_name) as product_name, latest(login_id) as login_id, latest(resolution_category_tier_2) as PT_res_cat_2 by incident_number&lt;BR /&gt;
| lookup userid_lookup.csv impacted_Userid as login_id OUTPUTNEW impacted_Name impacted_Company impacted_street_address&lt;BR /&gt;&lt;BR /&gt;
| stats count(incident_number) as PT_count by impacted_Name, impacted_Company, impacted_street_address ]   &lt;/P&gt;

&lt;P&gt;| table impacted_Name  ALL_count PT_count &lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/228639-how-to.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354216#M163164</guid>
      <dc:creator>TDR57</dc:creator>
      <dc:date>2020-09-29T17:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354217#M163165</link>
      <description>&lt;P&gt;@TDR57, can you give your current query and also sample of some of the raw events?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 05:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354217#M163165</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-02T05:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354218#M163166</link>
      <description>&lt;P&gt;if I understood it correctly i.e.  you have three columns namely impacted_Name, ALL_count, PT_count&lt;BR /&gt;
and you want impacted _name who have null PT_count...if so then try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| table impacted_Name ALL_count PT_count|stats sum(ALL_count) as ALL_count, sum(PT_count) as PT_count by impacted_Name |fillnull|where PT_count  = 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354218#M163166</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2020-09-29T17:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354219#M163167</link>
      <description>&lt;P&gt;can you try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=itam sourcetype=itam_inc_xml (product_name="prod name" OR product_name="prod name2") AND service_type="User*" AND status="Closed" OR status="Resolved" 
| stats latest(product_name) as product_name, latest(login_id) as login_id, latest(resolution_category_tier_2) as All_res_cat_2 by incident_number 
| lookup userid_lookup.csv impacted_Userid as login_id OUTPUTNEW impacted_Name impacted_Company impacted_street_address 
| stats count(incident_number) as ALL_count by impacted_Name, impacted_Company, impacted_street_address 
| join impacted_Name type=outer 
    [ search index=itam sourcetype=itam_inc_xml (product_name="prod name" OR product_name="prod name2") AND service_type="User*" AND status="Closed" OR status="Resolved" AND resolution_category_tier_2="Process" OR resolution_category_tier_2="Training" 
    | stats latest(product_name) as product_name, latest(login_id) as login_id, latest(resolution_category_tier_2) as PT_res_cat_2 by incident_number 
    | lookup userid_lookup.csv impacted_Userid as login_id OUTPUTNEW impacted_Name impacted_Company impacted_street_address 
    | stats count(incident_number) as PT_count by impacted_Name, impacted_Company, impacted_street_address ] 
| table impacted_Name ALL_count PT_count 
| where isnull(PT_count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354219#M163167</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-02T07:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354220#M163168</link>
      <description>&lt;P&gt;Thank you so much that worked a treat&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 07:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354220#M163168</guid>
      <dc:creator>TDR57</dc:creator>
      <dc:date>2018-02-05T07:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two search results to produce unique results within a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354221#M163169</link>
      <description>&lt;P&gt;It sounds like this comment contained the solution.  You might consider converting it to an answer (or editing your answer to include it), so @TDR57 can accept it.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 14:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-search-results-to-produce-unique-results/m-p/354221#M163169</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-05T14:19:15Z</dc:date>
    </item>
  </channel>
</rss>

