<?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 and trigger an email alert when there are no logs generated in a directory? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206755#M60218</link>
    <description>&lt;P&gt;Splunk doesn't monitor the hosts directly, but you can use the unix app, or simply configure a scripted input to run a shell command like df periodically to report the free disk space.  &lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2015 22:30:22 GMT</pubDate>
    <dc:creator>steveyz</dc:creator>
    <dc:date>2015-10-27T22:30:22Z</dc:date>
    <item>
      <title>How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206751#M60214</link>
      <description>&lt;P&gt;I am needing to create an Alert to run every 30 minutes to monitor the file size of all the log files in a directory &lt;CODE&gt;/opt/data/cassandra/logs&lt;/CODE&gt;. When the logs directory is empty, I have to set up an alert to trigger an email. How to write a Splunk search for this? Thanks &lt;/P&gt;

&lt;P&gt;I have &lt;CODE&gt;/opt/data/cassandra/logs&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Whenever there are no logs generated in this log directory, I have to send an alert email.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 17:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206751#M60214</guid>
      <dc:creator>venkatdba64</dc:creator>
      <dc:date>2015-10-27T17:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206752#M60215</link>
      <description>&lt;P&gt;Hi @venkatdba64,&lt;BR /&gt;
It seems like you might be able to use an advanced conditional alert, where you apply additional custom conditions to your search results in order to manage alert triggering. For example, if your search returns no log files, or some other indicator that the directory is empty (perhaps total file size == 0?), then you can trigger the alert.&lt;/P&gt;

&lt;P&gt;See this topic in our documentation:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/Alert/Definescheduledalerts#Set_up_triggering_conditions_for_a_scheduled_alert"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/Alert/Definescheduledalerts#Set_up_triggering_conditions_for_a_scheduled_alert&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'm not sure what version of the product you're using, but when you set up an alert, you can set up trigger conditions for it. You can create a custom condition expression to evaluate the search results you get. This custom condition helps manage alert triggering.&lt;/P&gt;

&lt;P&gt;I hope this helps! Let me know if not.&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 17:33:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206752#M60215</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-10-27T17:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206753#M60216</link>
      <description>&lt;P&gt;I am using splunk 6.2 . can I monitor the disk space  of hosts  from splunk gui  like . I am good to set the alert but my problem to how to get the info with query &lt;/P&gt;

&lt;P&gt;I am trying this&lt;BR /&gt;
index=aws-**  host=venkatdba64   | timechart avg("%_Free_Space") by host . but this is not working for me &lt;/P&gt;

&lt;P&gt;host  freespace  usedspace  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206753#M60216</guid>
      <dc:creator>venkatdba64</dc:creator>
      <dc:date>2020-09-29T07:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206754#M60217</link>
      <description>&lt;P&gt;Ok. I'm not sure about your query, where you're searching for "host=venkatdba64" and then piping the result to your timechart command and trying to average by host. Are there other hosts whose percentage of free space you are trying to capture?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 19:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206754#M60217</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-10-27T19:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206755#M60218</link>
      <description>&lt;P&gt;Splunk doesn't monitor the hosts directly, but you can use the unix app, or simply configure a scripted input to run a shell command like df periodically to report the free disk space.  &lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 22:30:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206755#M60218</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2015-10-27T22:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206756#M60219</link>
      <description>&lt;P&gt;Are you using &lt;CODE&gt;batch&lt;/CODE&gt; with &lt;CODE&gt;move_policy = sinkhole&lt;/CODE&gt; and forwarding the logs into Splunk?&lt;BR /&gt;
Have you configured your own scripted input to do &lt;CODE&gt;/bin/ls -altr /opt/data/cassandra/logs/ | wc -l | awk '{$1 = $1 - 3; print $1}'&lt;/CODE&gt;?&lt;BR /&gt;
What &lt;EM&gt;EXACTLY&lt;/EM&gt; are you pushing into splunk that would allow you to see if the directory is empty or not?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 04:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206756#M60219</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-06T04:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for and trigger an email alert when there are no logs generated in a directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206757#M60220</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;Maybe this logic will be of assistance?&lt;/P&gt;

&lt;P&gt;This logic is designed to create an alert for investigation where Splunk has detected no events within a given sourcetype within the past 2 hours.  It does not address your concern of log files not being created, but would be a good indicator that this has not happened.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count dc(host) AS distinct_hosts latest(_time) AS latest_time WHERE index=* BY sourcetype
| where latest_time&amp;lt;=relative_time(now(), "-2h") 
| sort -latest_time 
| convert timeformat="%H:%M:%S %d/%m/%Y" ctime(latest_time)
| where count=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Nov 2018 02:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-and-trigger-an-email-alert-when-there-are-no/m-p/206757#M60220</guid>
      <dc:creator>MikeElliott</dc:creator>
      <dc:date>2018-11-14T02:49:35Z</dc:date>
    </item>
  </channel>
</rss>

