<?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: checking if a a process is still running (time based comparison of event counts) in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/checking-if-a-a-process-is-still-running-time-based-comparison/m-p/96032#M1389</link>
    <description>&lt;P&gt;after hour of reading several postings here finally I found a solution for this problem.&lt;/P&gt;

&lt;P&gt;my problem is nothing else as determining the gap between the last log info and now. Well, this search does it for me now:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/logs/processes.log earliest=-2h | stats max(_time) As LatestTime by process | eval Gap=(now()-LatestTime) | search Gap&amp;gt;3600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;means: every process what was "seen" in the last 2 hours must be "seen" during the last hour also. If not I can raise an alert now!&lt;/P&gt;</description>
    <pubDate>Sun, 13 Oct 2013 15:29:25 GMT</pubDate>
    <dc:creator>petersob</dc:creator>
    <dc:date>2013-10-13T15:29:25Z</dc:date>
    <item>
      <title>checking if a a process is still running (time based comparison of event counts)</title>
      <link>https://community.splunk.com/t5/Alerting/checking-if-a-a-process-is-still-running-time-based-comparison/m-p/96031#M1388</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I want to check if a process is still running. The process is logging periodically a short info on polling a directory.&lt;BR /&gt;
Now, I will to use that info to detect if the process is not running anymore.&lt;BR /&gt;
Normally, a simple search for the info would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search myprocess is doing the work
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then defining the alert for eventcount = 0 would do the job. But...&lt;BR /&gt;
I would like to do it in a generic way, that means, that "&lt;EM&gt;is doing the work&lt;/EM&gt;" is actually unknown. This has to work with every process which is logging something periodically.&lt;/P&gt;

&lt;P&gt;Now, I have a defined a search doing a simple event count over time periods (hourly):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/logs/processes.log earliest=-3h@h | chart count over process by _time span=1h 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this give me a table like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;process    1381651200    1381654800    1381658400
myproc1    12            12            1
myproc2    15            15            0
myproc3    233           243           102
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;well, that means that the process "myproc2" did not log anything in the last hour and I need an alert for that issue.&lt;/P&gt;

&lt;P&gt;What I've tried is to extract somehow the last column and evaluate the apopriate process name (process column) but I couldn't get it done.&lt;/P&gt;

&lt;P&gt;Any Ideas hot to do that? &lt;BR /&gt;
Maybe I'm thinking too complicated?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Peter&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2013 10:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/checking-if-a-a-process-is-still-running-time-based-comparison/m-p/96031#M1388</guid>
      <dc:creator>petersob</dc:creator>
      <dc:date>2013-10-13T10:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: checking if a a process is still running (time based comparison of event counts)</title>
      <link>https://community.splunk.com/t5/Alerting/checking-if-a-a-process-is-still-running-time-based-comparison/m-p/96032#M1389</link>
      <description>&lt;P&gt;after hour of reading several postings here finally I found a solution for this problem.&lt;/P&gt;

&lt;P&gt;my problem is nothing else as determining the gap between the last log info and now. Well, this search does it for me now:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/logs/processes.log earliest=-2h | stats max(_time) As LatestTime by process | eval Gap=(now()-LatestTime) | search Gap&amp;gt;3600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;means: every process what was "seen" in the last 2 hours must be "seen" during the last hour also. If not I can raise an alert now!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2013 15:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/checking-if-a-a-process-is-still-running-time-based-comparison/m-p/96032#M1389</guid>
      <dc:creator>petersob</dc:creator>
      <dc:date>2013-10-13T15:29:25Z</dc:date>
    </item>
  </channel>
</rss>

