<?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: Search if field value appears in another search or not in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-if-field-value-appears-in-another-search-or-not/m-p/341291#M101174</link>
    <description>&lt;P&gt;This will give you the list of DeviceId values that only appear in the ActiveSync search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange (source=otl_activesyncinventory OR source=otl_mobileiron)
| stats count by source DeviceId
| eventstats dc(source) as dc by DeviceId
| search dc=1 source=otl_activesyncinventory
| fields DeviceId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then use that search in the first step of you first search to get the full table of results you are looking for&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange source=otl_activesyncinventory 
[   
    search index=msexchange (source=otl_activesyncinventory OR source=otl_mobileiron)
    | stats count by source DeviceId
    | eventstats dc(source) as dc by DeviceId
    | search dc=1 source=otl_activesyncinventory
    | fields DeviceId
]
|dedup SamAccountName, DeviceId 
|table companyOu, SamAccountName, "AD Account Enabled", DeviceId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 07 Mar 2017 11:21:13 GMT</pubDate>
    <dc:creator>rjthibod</dc:creator>
    <dc:date>2017-03-07T11:21:13Z</dc:date>
    <item>
      <title>Search if field value appears in another search or not</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-if-field-value-appears-in-another-search-or-not/m-p/341290#M101173</link>
      <description>&lt;P&gt;Trying to find any DeviceId field values that appear in the ActiveSync search but NOT in the MobileIron search.&lt;BR /&gt;
What is the best way to do this?&lt;/P&gt;

&lt;P&gt;ActiveSync search:&lt;BR /&gt;
index=msexchange  source=otl_activesyncinventory&lt;BR /&gt;&lt;BR /&gt;
|dedup SamAccountName, DeviceId&lt;BR /&gt;&lt;BR /&gt;
|table companyOu, SamAccountName, "AD Account Enabled", DeviceId&lt;/P&gt;

&lt;P&gt;MobileIron search:&lt;BR /&gt;
index=msexchange source=otl_mobileiron&lt;BR /&gt;
| table, DeviceId, MailboxId, Status&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 11:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-if-field-value-appears-in-another-search-or-not/m-p/341290#M101173</guid>
      <dc:creator>smcdonald20</dc:creator>
      <dc:date>2017-03-07T11:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search if field value appears in another search or not</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-if-field-value-appears-in-another-search-or-not/m-p/341291#M101174</link>
      <description>&lt;P&gt;This will give you the list of DeviceId values that only appear in the ActiveSync search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange (source=otl_activesyncinventory OR source=otl_mobileiron)
| stats count by source DeviceId
| eventstats dc(source) as dc by DeviceId
| search dc=1 source=otl_activesyncinventory
| fields DeviceId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then use that search in the first step of you first search to get the full table of results you are looking for&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange source=otl_activesyncinventory 
[   
    search index=msexchange (source=otl_activesyncinventory OR source=otl_mobileiron)
    | stats count by source DeviceId
    | eventstats dc(source) as dc by DeviceId
    | search dc=1 source=otl_activesyncinventory
    | fields DeviceId
]
|dedup SamAccountName, DeviceId 
|table companyOu, SamAccountName, "AD Account Enabled", DeviceId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 11:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-if-field-value-appears-in-another-search-or-not/m-p/341291#M101174</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-03-07T11:21:13Z</dc:date>
    </item>
  </channel>
</rss>

