<?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 remove duplicates from results of two searches on two different fields that have some of the same values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267820#M80573</link>
    <description>&lt;P&gt;You can modify your search like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXXX com="xxxx" service= | rename service as state 
|append [ search index=XXXX com="xxxx" state= ] 
| dedup state |stats list(state)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Ishaan&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2016 11:32:43 GMT</pubDate>
    <dc:creator>ishaanshekhar</dc:creator>
    <dc:date>2016-05-24T11:32:43Z</dc:date>
    <item>
      <title>How to remove duplicates from results of two searches on two different fields that have some of the same values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267818#M80571</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;

&lt;P&gt;I launch a search with append to put the results of two searches together on different fields, but then I would like to remove the duplicates on these results:&lt;/P&gt;

&lt;P&gt;First LOG : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;24/05/2016 11:33:19,719 (...) service id : one
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;one&lt;/CODE&gt; is the value of the field &lt;STRONG&gt;Service&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Second LOG: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;24/05/2016 11:38:33,688 (...) service id : two
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;two&lt;/CODE&gt; is the value of the field &lt;STRONG&gt;state&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The two logs are written differently and these two service id have two different field names in Splunk.&lt;BR /&gt;
I've appended the two results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXXX com="*xxxx*" service=*  | append [ search
index=XXXX com="*xxxx*"  state=* ] 
| where state!= service |stats list(state)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I tried with &lt;CODE&gt;where&lt;/CODE&gt; to show the list, but without success!&lt;/P&gt;

&lt;P&gt;Any help is welcome &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 10:52:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267818#M80571</guid>
      <dc:creator>BaptVe</dc:creator>
      <dc:date>2016-05-24T10:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove duplicates from results of two searches on two different fields that have some of the same values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267819#M80572</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Make one field common. For example add to the second search: 'eval service=state'&lt;/LI&gt;
&lt;LI&gt;Use 'dedup service, index, com' (and all other fields that are the same, if there is a duplicate)&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 24 May 2016 11:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267819#M80572</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2016-05-24T11:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove duplicates from results of two searches on two different fields that have some of the same values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267820#M80573</link>
      <description>&lt;P&gt;You can modify your search like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXXX com="xxxx" service= | rename service as state 
|append [ search index=XXXX com="xxxx" state= ] 
| dedup state |stats list(state)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Ishaan&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2016 11:32:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-duplicates-from-results-of-two-searches-on-two/m-p/267820#M80573</guid>
      <dc:creator>ishaanshekhar</dc:creator>
      <dc:date>2016-05-24T11:32:43Z</dc:date>
    </item>
  </channel>
</rss>

