<?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 for active hosts over a period of time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24000#M4351</link>
    <description>&lt;P&gt;index=_internal source=*metrics.log group="tcpin_connections" earliest=-7d@d latest=@d&lt;BR /&gt;&lt;BR /&gt;
| eval sourceHost=if(isnull(hostname), sourceHost,hostname)&lt;BR /&gt;&lt;BR /&gt;
| stats sum(kb) as KB_thisweek by sourceHost | eval KB_thisweek = round(KB_thisweek)&lt;BR /&gt;&lt;BR /&gt;
| join type=outer sourceHost&lt;BR /&gt;&lt;BR /&gt;
[search index=_internal source=*metrics.log group="tcpin_connections"   earliest=-14d@d latest=-7d@d&lt;BR /&gt;&lt;BR /&gt;
| eval sourceHost=if(isnull(hostname), sourceHost,hostname)&lt;BR /&gt;&lt;BR /&gt;
| stats sum(kb) as KB_lastweek by sourceHost | eval KB_lastweek = round(KB_lastweek) ]&lt;BR /&gt;&lt;BR /&gt;
| eval NewThisWeek = if(KB_lastweek &amp;lt; 1,"New", "  ")&lt;BR /&gt;&lt;BR /&gt;
| eval MissingThisWeek = if  (KB_thisweek &amp;lt; 1, "Missing", "  ")&lt;BR /&gt;&lt;BR /&gt;
| where KB_lastweek &amp;lt; 1 or KB_thisweek &amp;lt; 1&lt;/P&gt;

&lt;P&gt;may be closer to what you want. This is based on the forwarders that connect to  Splunk, not the host names that are assigned to the data.&lt;BR /&gt;
Another alternative is to turn on the Deployment Monitor app that ships with Splunk...&lt;/P&gt;</description>
    <pubDate>Thu, 12 Apr 2012 05:44:00 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-04-12T05:44:00Z</dc:date>
    <item>
      <title>Search for active hosts over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/23999#M4350</link>
      <description>&lt;P&gt;I'm trying to check for hosts that were sending data last week and now are not, or newly added hosts.  I don't think the &lt;A href="http://splunk-base.splunk.com/answers/41687/list-of-hosts-for-a-given-time-range"&gt;answer here&lt;/A&gt; is actually a correct answer nor answers my problem.&lt;/P&gt;

&lt;P&gt;So far what I am thinking is to create a lookup:&lt;/P&gt;

&lt;P&gt;index=main earliest=-168h latest=-166h | dedup host | table host | outputlookup hosts_weekold.csv&lt;/P&gt;

&lt;P&gt;Then run searches on new data to find hosts that are in the lookup but not in current results, or vice versa.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 00:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/23999#M4350</guid>
      <dc:creator>jspears</dc:creator>
      <dc:date>2012-04-11T00:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Search for active hosts over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24000#M4351</link>
      <description>&lt;P&gt;index=_internal source=*metrics.log group="tcpin_connections" earliest=-7d@d latest=@d&lt;BR /&gt;&lt;BR /&gt;
| eval sourceHost=if(isnull(hostname), sourceHost,hostname)&lt;BR /&gt;&lt;BR /&gt;
| stats sum(kb) as KB_thisweek by sourceHost | eval KB_thisweek = round(KB_thisweek)&lt;BR /&gt;&lt;BR /&gt;
| join type=outer sourceHost&lt;BR /&gt;&lt;BR /&gt;
[search index=_internal source=*metrics.log group="tcpin_connections"   earliest=-14d@d latest=-7d@d&lt;BR /&gt;&lt;BR /&gt;
| eval sourceHost=if(isnull(hostname), sourceHost,hostname)&lt;BR /&gt;&lt;BR /&gt;
| stats sum(kb) as KB_lastweek by sourceHost | eval KB_lastweek = round(KB_lastweek) ]&lt;BR /&gt;&lt;BR /&gt;
| eval NewThisWeek = if(KB_lastweek &amp;lt; 1,"New", "  ")&lt;BR /&gt;&lt;BR /&gt;
| eval MissingThisWeek = if  (KB_thisweek &amp;lt; 1, "Missing", "  ")&lt;BR /&gt;&lt;BR /&gt;
| where KB_lastweek &amp;lt; 1 or KB_thisweek &amp;lt; 1&lt;/P&gt;

&lt;P&gt;may be closer to what you want. This is based on the forwarders that connect to  Splunk, not the host names that are assigned to the data.&lt;BR /&gt;
Another alternative is to turn on the Deployment Monitor app that ships with Splunk...&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2012 05:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24000#M4351</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-04-12T05:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Search for active hosts over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24001#M4352</link>
      <description>&lt;P&gt;This is a great answer!  Unfortunately I do need to see the hosts missing from the data, not just missing forwarders.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 12:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24001#M4352</guid>
      <dc:creator>jspears</dc:creator>
      <dc:date>2012-04-25T12:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Search for active hosts over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24002#M4353</link>
      <description>&lt;P&gt;Here is a new answer - this one is based on the hosts represented in the data, not the forwarders.&lt;BR /&gt;
It's another fun search!&lt;/P&gt;

&lt;P&gt;index=* earliest=-7d@d latest=@d&lt;BR /&gt;&lt;BR /&gt;
| eval indextime=_indextime&lt;BR /&gt;&lt;BR /&gt;
| fields host indextime&lt;BR /&gt;&lt;BR /&gt;
| stats max(indextime) as LastIndexedThisWeek count as EventsThisWeek by host&lt;BR /&gt;&lt;BR /&gt;
| join type=outer host&lt;BR /&gt;&lt;BR /&gt;
[search index=* earliest=-14d@d latest=-7d@d&lt;BR /&gt;&lt;BR /&gt;
| eval indextime=_indextime&lt;BR /&gt;&lt;BR /&gt;
| fields host indextime&lt;BR /&gt;&lt;BR /&gt;
| stats max(indextime) as LastIndexedLastWeek count as EventsLastWeek by host&lt;BR /&gt;&lt;BR /&gt;
 ]&lt;BR /&gt;&lt;BR /&gt;
| eval NewThisWeek = if(EventsLastWeek &amp;lt; 1,"New", " ")&lt;BR /&gt;&lt;BR /&gt;
| eval MissingThisWeek = if (EventsThisWeek &amp;lt; 1, "Missing", " ")&lt;BR /&gt;&lt;BR /&gt;
| fieldformat LastIndexedThisWeek = strftime(LastIndexedThisWeek ,"%x %X")&lt;BR /&gt;&lt;BR /&gt;
| fieldformat LastIndexedLastWeek = strftime(LastIndexedLastWeek ,"%x %X")&lt;BR /&gt;&lt;BR /&gt;
| table host LastIndexedThisWeek EventsThisWeek LastIndexedLastWeek EventsLastWeek NewThisWeek MissingThisWeek&lt;BR /&gt;&lt;BR /&gt;
| where EventsThisWeek &amp;lt; 1 or EventsLastWeek &amp;lt; 1  &lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 19:54:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-active-hosts-over-a-period-of-time/m-p/24002#M4353</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-04-25T19:54:07Z</dc:date>
    </item>
  </channel>
</rss>

