<?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: monitor file in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186771#M3122</link>
    <description>&lt;P&gt;Yes, it is quite simple. There are several ways to do it, but I recommend this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sources | where source="C:\test.txt" 
| eval "Last Update"=strftime(lasttime, "%c")
| table source "Last Update"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will list the file and the last time Splunk received data from that file. If this works for you, then use the following variation and alert if number of results &amp;gt; 0.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sources | where source="C:\test.txt" 
| where lasttime &amp;lt; now()-300
| eval "Last Update"=strftime(lasttime, "%c")
| table source "Last Update"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;now()-300&lt;/CODE&gt; is the epoch time of "5 minutes ago"&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2014 17:57:29 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2014-06-03T17:57:29Z</dc:date>
    <item>
      <title>monitor file</title>
      <link>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186769#M3120</link>
      <description>&lt;P&gt;I was just wondering if Splunk can be scheduled to monitor a unique file e.g c:\test.txt regularly, and send out alerts if this file does not get updated for a specific time period , lets say for 5 minutes.&lt;BR /&gt;
Please help, thks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 13:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186769#M3120</guid>
      <dc:creator>newbiesplunk</dc:creator>
      <dc:date>2014-06-03T13:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: monitor file</title>
      <link>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186770#M3121</link>
      <description>&lt;P&gt;A regular file monitoring can be setup for this file which will get indexed into a specific index/sourcetype. Once this is setup,  you can create a schedule search which will run every 5min and check if there are any data from the file in the specific index/sourcetype, if not than trigger alert.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 14:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186770#M3121</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T14:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: monitor file</title>
      <link>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186771#M3122</link>
      <description>&lt;P&gt;Yes, it is quite simple. There are several ways to do it, but I recommend this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sources | where source="C:\test.txt" 
| eval "Last Update"=strftime(lasttime, "%c")
| table source "Last Update"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will list the file and the last time Splunk received data from that file. If this works for you, then use the following variation and alert if number of results &amp;gt; 0.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sources | where source="C:\test.txt" 
| where lasttime &amp;lt; now()-300
| eval "Last Update"=strftime(lasttime, "%c")
| table source "Last Update"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;now()-300&lt;/CODE&gt; is the epoch time of "5 minutes ago"&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 17:57:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186771#M3122</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-06-03T17:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: monitor file</title>
      <link>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186772#M3123</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
when i entered | metadata type=sources | where source="C:\test.txt" &lt;BR /&gt;
| eval "Last Update"=strftime(lasttime, "%c")&lt;BR /&gt;
| table source "Last Update"to search, nothing returns even though i got one file. Anything else i need to set? thks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2014 13:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/monitor-file/m-p/186772#M3123</guid>
      <dc:creator>newbiesplunk</dc:creator>
      <dc:date>2014-06-05T13:09:13Z</dc:date>
    </item>
  </channel>
</rss>

