<?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 reconcile a field in two different sourcetypes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315384#M161047</link>
    <description>&lt;P&gt;Try this one:&lt;/P&gt;

&lt;P&gt;index=* sourcetype=sourcetype1 OR sourcetype=sourcetype2&lt;BR /&gt;
| stats dc(sourcetype as sourcetypes values(sourcetype) as sourcetype by tradeID&lt;BR /&gt;
| search sourcetype=sourcetype1 AND sourcetypes= 2&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2017 09:15:02 GMT</pubDate>
    <dc:creator>gvnd</dc:creator>
    <dc:date>2017-05-24T09:15:02Z</dc:date>
    <item>
      <title>How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315378#M161041</link>
      <description>&lt;P&gt;My use case is:&lt;BR /&gt;
There is sourcetype1, which has tradeID field; also sourcetype2, which also has tradeID field.&lt;/P&gt;

&lt;P&gt;I think sourcetype2 should be a subset of sourcetype1, and I want to do reconciliation.&lt;BR /&gt;
How to write a search so that it returns all tradeID in sourcetyp1, but not in sourcetype2?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 12:59:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315378#M161041</guid>
      <dc:creator>leonjxtan</dc:creator>
      <dc:date>2017-05-23T12:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315379#M161042</link>
      <description>&lt;P&gt;You can use a subsearch to find all tradeID in sourcetype2 and filter them from sourcetype1 -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=sourcetype1 NOT [ search sourcetype=sourcetype2 | dedup tradeID | table tradeID ] | dedup tradeID | table tradeID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2017 13:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315379#M161042</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-05-23T13:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315380#M161043</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;I tried this search, but strangely 9 seconds are spent on parsing the search. Is it normal for sub-search?&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;918.18     startup.handoff&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 23 May 2017 13:22:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315380#M161043</guid>
      <dc:creator>leonjxtan</dc:creator>
      <dc:date>2017-05-23T13:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315381#M161044</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=sourcetype1 OR sourcetype=sourcetype2 | stats count by tradeID,sourcetype | xyseries tradeID sourcetype count | fillnull sourcetype1 sourcetype
 2 | search sourcetype1&amp;gt;0 sourcetype2=0 | fields tradeID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2017 13:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315381#M161044</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2017-05-23T13:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315382#M161045</link>
      <description>&lt;P&gt;This approach should be faster -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=sourcetype1 OR sourcetype=sourcetype2 | eval flag=if(sourcetype=sourcetype2,1,0) | stats sum(flag) as flag by traceID | where flag=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2017 13:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315382#M161045</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-05-23T13:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315383#M161046</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=sourcetype1 OR sourcetype=sourcetype2
| eval tradeID=if((sourcetype=sourcetype1), tradeID, null())
| Your Other Stuff Here
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2017 21:51:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315383#M161046</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-23T21:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to reconcile a field in two different sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315384#M161047</link>
      <description>&lt;P&gt;Try this one:&lt;/P&gt;

&lt;P&gt;index=* sourcetype=sourcetype1 OR sourcetype=sourcetype2&lt;BR /&gt;
| stats dc(sourcetype as sourcetypes values(sourcetype) as sourcetype by tradeID&lt;BR /&gt;
| search sourcetype=sourcetype1 AND sourcetypes= 2&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 09:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reconcile-a-field-in-two-different-sourcetypes/m-p/315384#M161047</guid>
      <dc:creator>gvnd</dc:creator>
      <dc:date>2017-05-24T09:15:02Z</dc:date>
    </item>
  </channel>
</rss>

