<?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 compose a search to compare the difference between hosts? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227659#M67242</link>
    <description>&lt;P&gt;Why don't you just try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index NOT  "+[CHAIN] RETAIL_LOCATION_CLOSE"|fields host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Jan 2017 03:30:39 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2017-01-12T03:30:39Z</dc:date>
    <item>
      <title>How to compose a search to compare the difference between hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227658#M67241</link>
      <description>&lt;P&gt;I am trying to build an alert off based of a search that shows me only hosts that have &lt;STRONG&gt;not&lt;/STRONG&gt; logged the following string in an event within the last 4 hours: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"+[CHAIN] RETAIL_LOCATION_CLOSE" NOT ORDER
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this string isn't logged by a host, it tells me the operator did not perform an administrative task and I will want these hosts to appear in an alert. &lt;/P&gt;

&lt;P&gt;I am assuming I need to perform two searches and compare the difference, but I am having a hard time composing the search. &lt;/P&gt;

&lt;P&gt;So far I have the following, but I am not getting the expected result (which is the host difference between both searches)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [search index=my_index "+[CHAIN] RETAIL_LOCATION_CLOSE" NOT ORDER | table store ] [search index=my_index   | table store]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first search is for my string of interest and the second is just a generic search to return all of the hosts in the index who are logging. I'd like to subtract all hosts who appear in the first search from those that appear in the second, and the difference is my list of hosts who need to be followed up with.&lt;/P&gt;

&lt;P&gt;Any help for a big giant Splunk newb would be very appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 00:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227658#M67241</guid>
      <dc:creator>masongalindo</dc:creator>
      <dc:date>2017-01-12T00:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to compose a search to compare the difference between hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227659#M67242</link>
      <description>&lt;P&gt;Why don't you just try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index NOT  "+[CHAIN] RETAIL_LOCATION_CLOSE"|fields host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jan 2017 03:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227659#M67242</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2017-01-12T03:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to compose a search to compare the difference between hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227660#M67243</link>
      <description>&lt;P&gt;That wouldn't help because you can't search for something that isn't there.  masongalindo's approach is the right one - start with all hosts and take away those that did something then you're left with those that did not do that thing.  See &lt;A href="https://answers.splunk.com/answers/456120/how-to-find-routers-that-are-not-reporting-a-speci.html"&gt;https://answers.splunk.com/answers/456120/how-to-find-routers-that-are-not-reporting-a-speci.html&lt;/A&gt; for a solution that uses a lookup table.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 05:04:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227660#M67243</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-01-12T05:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to compose a search to compare the difference between hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227661#M67244</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;index=foo1 NOT [search index=foo1 "+[CHAIN] RETAIL_LOCATION_CLOSE" NOT ORDER | dedup host | table host | format] | stats values(host)&lt;/P&gt;

&lt;P&gt;The subsearch generates a list of unique hosts which have the specified string then formats the list for use in splunk search language. The base search takes that list and shows you everything not in it, that being, the severs that do not have the specified string. You can then alert off the results of the base search.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:22:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compose-a-search-to-compare-the-difference-between-hosts/m-p/227661#M67244</guid>
      <dc:creator>bkeif</dc:creator>
      <dc:date>2020-09-29T12:22:23Z</dc:date>
    </item>
  </channel>
</rss>

