<?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: Alert if there are no logs (by host and by sourcetype) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482723#M135220</link>
    <description>&lt;P&gt;Got it.&lt;BR /&gt;
Thank you @gcusello !&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 08:22:41 GMT</pubDate>
    <dc:creator>woodentree</dc:creator>
    <dc:date>2020-02-28T08:22:41Z</dc:date>
    <item>
      <title>Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482716#M135213</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;We scheduled a search that alerts us if we do not receive logs from any of our hosts since &amp;gt;5 minutes. It looks like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts index=* | eval age=now()-lastTime | where age&amp;gt;3600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, there is an issue - it does not work if we partly receive logs from the host (let's say, only 1 sourcetype out of 2).&lt;/P&gt;

&lt;P&gt;Do you know a way to create the same alert by host &lt;STRONG&gt;AND&lt;/STRONG&gt; by sourcetype at the same time?&lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 16:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482716#M135213</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-25T16:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482717#M135214</link>
      <description>&lt;P&gt;Hi @woodentree,&lt;BR /&gt;
you have to create a lookup containing the list of hosts to monitor (called e.g. perimeter.csv) containing at least one field (host) or also more information.&lt;BR /&gt;
Then you can schedule a search e.g. every five minutes like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metasearch index=_internal
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup perimeter.csv | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total BY host
| where total=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case you're sure that an host is sending logs to Splunk.&lt;BR /&gt;
If instead you want to monitor that are arriving logs on an index with a sourcetype, you can modify the main search in this way, using the same approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metasearch index=your_index sourcetype=your_sourcetype
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup perimeter.csv | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total BY host
| where total=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 16:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482717#M135214</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-25T16:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482718#M135215</link>
      <description>&lt;P&gt;Hi @gcusello,&lt;/P&gt;

&lt;P&gt;Appreciate your help!&lt;/P&gt;

&lt;P&gt;However, our goal is slightly different: we do not like to monitor some particular sourcetype, but all of them. The goal is to know if &lt;STRONG&gt;any&lt;/STRONG&gt; of our hosts does not receive logs of &lt;STRONG&gt;any&lt;/STRONG&gt; sourcetype.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 13:23:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482718#M135215</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-27T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482719#M135216</link>
      <description>&lt;P&gt;your use case is simplar than I thought: you need to know if there are hosts that don't receive anything, so try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | metasearch index=*
 | eval host=lower(host)
 | stats count BY host
 | append [ | inputlookup perimeter.csv | eval host=lower(host), count=0 | fields host count ]
 | stats sum(count) AS total BY host
 | where total=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 13:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482719#M135216</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-27T13:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482720#M135217</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats latest(_time) as lastSeen where index IN(*) by host sourcetype
|eval delay=round ((now() - lastSeen)/60/60/24,2)
|eval lastSeen=strftime(lastSeen, "%Y/%m/%d %H:%M:%S")
|search delay&amp;gt;1 
|eval HostName=lower(host)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 13:49:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482720#M135217</guid>
      <dc:creator>sumanssah</dc:creator>
      <dc:date>2020-02-27T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482721#M135218</link>
      <description>&lt;P&gt;Gorgeous! That what we was searching for.&lt;BR /&gt;
Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 14:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482721#M135218</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-27T14:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482722#M135219</link>
      <description>&lt;P&gt;Thanks for confirming &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 15:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482722#M135219</guid>
      <dc:creator>sumanssah</dc:creator>
      <dc:date>2020-02-27T15:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if there are no logs (by host and by sourcetype)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482723#M135220</link>
      <description>&lt;P&gt;Got it.&lt;BR /&gt;
Thank you @gcusello !&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 08:22:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Alert-if-there-are-no-logs-by-host-and-by-sourcetype/m-p/482723#M135220</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-28T08:22:41Z</dc:date>
    </item>
  </channel>
</rss>

