<?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: Display hosts that didn't have events only in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142741#M29170</link>
    <description>&lt;P&gt;To qualify this answer -- &lt;CODE&gt;join&lt;/CODE&gt; is almost never the right answer - generally anything you might think to do with &lt;CODE&gt;join&lt;/CODE&gt; is better done with &lt;CODE&gt;stats&lt;/CODE&gt; or with a lookup.  However here is one case where join gives you a nice short path and as long as the lookup does not become very large it will be reliable.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest = -15m latest=now 
| stats count by host 
| join type="outer" [ | inputlookup "Corp_Hosts.csv" | rename Host_Name as host | fields host]
| stats sum(count) as count by host
| search count=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more normal caveats about the &lt;CODE&gt;join&lt;/CODE&gt; command - &lt;A href="http://answers.splunk.com/answers/822/simulating-a-sql-join-in-splunk"&gt;http://answers.splunk.com/answers/822/simulating-a-sql-join-in-splunk&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;For fun here's a second way that uses a subsearch. The use of the format command here will yield &lt;CODE&gt;NOT host=host1 NOT host=host2 NOT host=host3&lt;/CODE&gt; etc.  so the end result is you'll get search results that are the hosts that had no events. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup "Corp_Hosts.csv" 
| rename Host_Name as host 
[ search earliest = -15m latest=now 
| stats count by host
| fields host
| format "" "NOT" "" "" "" ""]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More about subsearches - &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Aboutsubsearches"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Aboutsubsearches&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Apr 2014 07:24:23 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2014-04-25T07:24:23Z</dc:date>
    <item>
      <title>Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142740#M29169</link>
      <description>&lt;P&gt;Hey There,&lt;BR /&gt;
I have a list of 150 servers which listed in a csv file (lookup table). Here's my current search &lt;EM&gt;earliest = -15m latest=now [inputlookup "Corp_Hosts.csv"|rename Host_Name as host|fields host]|stats count by host&lt;/EM&gt; and i get 70 hosts as a result with events. How can i table list of hosts that didn't have any events? In this case the rest of the 80 only?&lt;/P&gt;

&lt;P&gt;Thank you in advance,&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142740#M29169</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2020-09-28T16:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142741#M29170</link>
      <description>&lt;P&gt;To qualify this answer -- &lt;CODE&gt;join&lt;/CODE&gt; is almost never the right answer - generally anything you might think to do with &lt;CODE&gt;join&lt;/CODE&gt; is better done with &lt;CODE&gt;stats&lt;/CODE&gt; or with a lookup.  However here is one case where join gives you a nice short path and as long as the lookup does not become very large it will be reliable.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest = -15m latest=now 
| stats count by host 
| join type="outer" [ | inputlookup "Corp_Hosts.csv" | rename Host_Name as host | fields host]
| stats sum(count) as count by host
| search count=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more normal caveats about the &lt;CODE&gt;join&lt;/CODE&gt; command - &lt;A href="http://answers.splunk.com/answers/822/simulating-a-sql-join-in-splunk"&gt;http://answers.splunk.com/answers/822/simulating-a-sql-join-in-splunk&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;For fun here's a second way that uses a subsearch. The use of the format command here will yield &lt;CODE&gt;NOT host=host1 NOT host=host2 NOT host=host3&lt;/CODE&gt; etc.  so the end result is you'll get search results that are the hosts that had no events. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup "Corp_Hosts.csv" 
| rename Host_Name as host 
[ search earliest = -15m latest=now 
| stats count by host
| fields host
| format "" "NOT" "" "" "" ""]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More about subsearches - &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Aboutsubsearches"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Aboutsubsearches&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 07:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142741#M29170</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2014-04-25T07:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142742#M29171</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I tried the first part, instead of comparing the eventful hosts with the csv, it actually lists the entire host list in the environment.Any other suggestions?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 14:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142742#M29171</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-04-25T14:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142743#M29172</link>
      <description>&lt;P&gt;Try the second option (subsearch) OR try this&lt;/P&gt;

&lt;P&gt;| inputlookup "Corp_Hosts.csv" &lt;BR /&gt;
| rename Host_Name as host | search NOT [search earliest = -15m latest=now &lt;BR /&gt;
| stats count by host&lt;BR /&gt;
| fields - count&lt;BR /&gt;
| format]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142743#M29172</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142744#M29173</link>
      <description>&lt;P&gt;Oh sorry - yea I made a bad assumption that the hosts lookup contained all indexed hosts - somesoni2's modified version of the first search will work for you.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 18:22:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142744#M29173</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2014-04-25T18:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142745#M29174</link>
      <description>&lt;P&gt;Excellent That worked!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 16:24:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142745#M29174</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-05-01T16:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Display hosts that didn't have events only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142746#M29175</link>
      <description>&lt;P&gt;Please accept the answer if there are not followup quetions.&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 17:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Display-hosts-that-didn-t-have-events-only/m-p/142746#M29175</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-01T17:26:03Z</dc:date>
    </item>
  </channel>
</rss>

