<?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 How do you create an alert for  different cron schedules? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435098#M124086</link>
    <description>&lt;P&gt;We have 4 tasks that run on different schedules and log an event in the application logs when the job starts.  The task is to alert if the job doesn't run on a prescribed schedule.  Can this be done with a single search command ?&lt;/P&gt;

&lt;P&gt;JobA    0 02 * * *&lt;BR /&gt;
JobB    0 2/4 * * *&lt;BR /&gt;
JobC    0 03 * * *&lt;BR /&gt;
JobD .     0 0/2 * * *&lt;/P&gt;

&lt;P&gt;Event produced in Log - &lt;/P&gt;

&lt;P&gt;[2018-08-29 06:00:00,912] {Worker #04283bd8} INFO JobA::Execute - ********************** Job Name : AgedApplicationNotificationJob - started at : 8/29/2018 6:00:00 AM **********************&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 29 Aug 2018 20:27:25 GMT</pubDate>
    <dc:creator>nmohammed</dc:creator>
    <dc:date>2018-08-29T20:27:25Z</dc:date>
    <item>
      <title>How do you create an alert for  different cron schedules?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435098#M124086</link>
      <description>&lt;P&gt;We have 4 tasks that run on different schedules and log an event in the application logs when the job starts.  The task is to alert if the job doesn't run on a prescribed schedule.  Can this be done with a single search command ?&lt;/P&gt;

&lt;P&gt;JobA    0 02 * * *&lt;BR /&gt;
JobB    0 2/4 * * *&lt;BR /&gt;
JobC    0 03 * * *&lt;BR /&gt;
JobD .     0 0/2 * * *&lt;/P&gt;

&lt;P&gt;Event produced in Log - &lt;/P&gt;

&lt;P&gt;[2018-08-29 06:00:00,912] {Worker #04283bd8} INFO JobA::Execute - ********************** Job Name : AgedApplicationNotificationJob - started at : 8/29/2018 6:00:00 AM **********************&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 20:27:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435098#M124086</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2018-08-29T20:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create an alert for  different cron schedules?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435099#M124087</link>
      <description>&lt;P&gt;JobName  Cron Schedule&lt;BR /&gt;
JobA             0 02  * * * &lt;BR /&gt;
JobB             0 2/4 * * *&lt;BR /&gt;
JobC             0 03 * * *&lt;BR /&gt;
JobD .           0 0/2 * * *&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 20:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435099#M124087</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2018-08-29T20:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create an alert for  different cron schedules?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435100#M124088</link>
      <description>&lt;P&gt;@nmohammed,&lt;/P&gt;

&lt;P&gt;Yes you can achieve it. If you have Started at as a separate field then by extracting the Hours separately and compare with epoc time. Else you need to write a regex to extract Started at filed and achieve it . &lt;/P&gt;

&lt;P&gt;Example: If this job need to start at 4 am but it started at 6 am. lets see how we can check it and trigger a alert.&lt;BR /&gt;
started at : 8/29/2018 6:00:00 AM. You can write an alert.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   | makeresults 
    | eval data=strftime(strptime("8/29/2018 6:00:00 AM","%m/%d/%Y %H"),"%H")
    | eval calc=if(data=04,1,0)
    | table data calc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Aug 2018 05:04:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435100#M124088</guid>
      <dc:creator>Shan</dc:creator>
      <dc:date>2018-08-30T05:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create an alert for  different cron schedules?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435101#M124089</link>
      <description>&lt;P&gt;Hi @nmohammed,&lt;/P&gt;

&lt;P&gt;Did the below answer answer your question? If so, please resolve this post by approving the answer below. If not, keep us updated so that someone else can help solve your problem.&lt;/P&gt;

&lt;P&gt;Also, if you're feeling generous, give out an upvote to the user that helped ya. Our users love them upvotes. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 22:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-an-alert-for-different-cron-schedules/m-p/435101#M124089</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-08-30T22:36:21Z</dc:date>
    </item>
  </channel>
</rss>

