<?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 search for field values that are returned in one search that don't appear in another search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115275#M30527</link>
    <description>&lt;P&gt;All other answers are subject to very low limits (50K rows) and will be incorrect for even modest set sizes.  Here is a way to do it in a vastly less limited way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|multisearch
[ SourceIP="*" earliest=-48h@h latest=-24h@h | stats count by SourceIP | fields SourceIP | eval type="keepers" | outputcsv keepers.csv]
[ SourceIP="*" earliest=-24h@h | stats count by SourceIP | fields SourceIP | eval type="droppers" | outputcsv droppers.csv]
| search thisFieldWillNeverExist="So this will drop all events"
| appendpipe [|inputcsv keepers.csv]
| appendpipe [|inputcsv droppers.csv]
| stats values(*) AS * BY SourceIP
| search type="keepers" NOT type="droppers"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 May 2016 04:49:56 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-05-26T04:49:56Z</dc:date>
    <item>
      <title>How to search for field values that are returned in one search that don't appear in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115271#M30523</link>
      <description>&lt;P&gt;I am trying to come up with the search syntax that would get me the the values of a field that exist in one search that don't exist in another search.  IE:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SourceIP="*" earliest=-48h@h latest=-24h@h | stats count by SourceIP | fields SourceIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SourceIP="*" earliest=-24h@h | stats count by SourceIP | fields SourceIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm looking for the values of SourceIP that were present in search 1 that are not present in search 2.&lt;/P&gt;

&lt;P&gt;Is there a way to do this that can process quickly?  There should be about 11,000 unique values coming from each search.  I just want to know which ones didn't occur today.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2014 22:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115271#M30523</guid>
      <dc:creator>djconroy</dc:creator>
      <dc:date>2014-11-10T22:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for field values that are returned in one search that don't appear in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115272#M30524</link>
      <description>&lt;P&gt;Have you looked at the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Diff"&gt;diff&lt;/A&gt; command?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2014 22:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115272#M30524</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2014-11-10T22:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for field values that are returned in one search that don't appear in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115273#M30525</link>
      <description>&lt;P&gt;I am looking at it now... theoretically, how would I send the values from the search into the set diff command?&lt;/P&gt;

&lt;P&gt;Essentially I would need to pipe 11,000 different values into each subsearch.&lt;/P&gt;

&lt;P&gt;Also, I see that the set diff command works for less than 10,000 results.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 15:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115273#M30525</guid>
      <dc:creator>djconroy</dc:creator>
      <dc:date>2014-11-11T15:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for field values that are returned in one search that don't appear in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115274#M30526</link>
      <description>&lt;P&gt;After looking through the set diff docs and searching Google I found this previous &lt;A href="http://answers.splunk.com/answers/33791/compare-field-from-2-sources-and-return-when-source1-has-no-match-in-source2.html"&gt;quesion&lt;/A&gt;:&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/33791/compare-field-from-2-sources-and-return-when-source1-has-no-match-in-source2.html"&gt;http://answers.splunk.com/answers/33791/compare-field-from-2-sources-and-return-when-source1-has-no-match-in-source2.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;That gave me the guidance to use a join outer and an if-match command to determine which clients were not communicating in the last 24 hours that should be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| index=myindex source=mysource sourcetype=mysourcetype * SourceIP="*" earliest=-48h@h latest=-24h@h
| dedup SourceIP
|  eval Client=SourceIP
| eval status1="Active"
| join Client type=outer [search index=myindex source=mysource sourcetype=mysourcetype * SourceIP="*" earliest=-24h@h
| dedup SourceIP
| eval Client=SourceIP
| eval status2 = "Active" ]
| eval Status = if(match(status1,status2), "Active", "Not Responding")
| table Client Status
| where Status="Not Responding"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Nov 2014 16:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115274#M30526</guid>
      <dc:creator>djconroy</dc:creator>
      <dc:date>2014-11-11T16:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for field values that are returned in one search that don't appear in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115275#M30527</link>
      <description>&lt;P&gt;All other answers are subject to very low limits (50K rows) and will be incorrect for even modest set sizes.  Here is a way to do it in a vastly less limited way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|multisearch
[ SourceIP="*" earliest=-48h@h latest=-24h@h | stats count by SourceIP | fields SourceIP | eval type="keepers" | outputcsv keepers.csv]
[ SourceIP="*" earliest=-24h@h | stats count by SourceIP | fields SourceIP | eval type="droppers" | outputcsv droppers.csv]
| search thisFieldWillNeverExist="So this will drop all events"
| appendpipe [|inputcsv keepers.csv]
| appendpipe [|inputcsv droppers.csv]
| stats values(*) AS * BY SourceIP
| search type="keepers" NOT type="droppers"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2016 04:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-field-values-that-are-returned-in-one-search/m-p/115275#M30527</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-26T04:49:56Z</dc:date>
    </item>
  </channel>
</rss>

