<?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 can I create an alert for long running jobs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616437#M214240</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/238212"&gt;@sjringo&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot, seems like it is working, Could you please help me to understand how it works&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance,&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Theja Boddhaluru&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Oct 2022 14:11:13 GMT</pubDate>
    <dc:creator>thejasplunk67</dc:creator>
    <dc:date>2022-10-08T14:11:13Z</dc:date>
    <item>
      <title>How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616144#M214126</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;Search to trigger an alert when the particular job (scheduled jobs) is running more than the threshold time (lets say 5 mins).&lt;BR /&gt;I have fields to create an alert are Job name (unique),&amp;nbsp; source, source type, index and time.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Theja&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 13:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616144#M214126</guid>
      <dc:creator>thejasplunk67</dc:creator>
      <dc:date>2022-10-06T13:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616188#M214156</link>
      <description>&lt;P&gt;You could run a search on a schedule that checks the status of current jobs using the search/jobs API endpoint and then look at the runDuration for those jobs and see when they are running more than a certain threshold.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like the following will get you started.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/search/jobs search="delegate=scheduler" | fields label savedSearchLabel published dispatchState runDuration delegate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remember, there are lots more fields available for the results returned from the search/jobs API endpoint, so you can always rework the search to use some of those other fields also.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 14:43:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616188#M214156</guid>
      <dc:creator>jdunlea</dc:creator>
      <dc:date>2022-10-06T14:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616296#M214203</link>
      <description>&lt;P class="lia-align-justify"&gt;Hi jdunlea,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How can I calculate the time while running the running the job?, I have time filed to see when the job is running but struggling to calculate the time of running job and parallelly checking with the threshold time weather running job is crossing.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Note:&amp;nbsp; Unique field i have job name alone, and to calculate time we have time field ( Formate eg:&amp;nbsp;&lt;SPAN&gt;9/18/22&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1:20:04.585 AM)&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&amp;nbsp;&lt;BR /&gt;Theja&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 10:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616296#M214203</guid>
      <dc:creator>thejasplunk67</dc:creator>
      <dc:date>2022-10-07T10:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616311#M214205</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have been working on something very similar.&amp;nbsp; I am somewhat new so this might not be the 'best' solution but it will work.&amp;nbsp; Replace 300 with your threshold value.&amp;nbsp; Then when setting up your alert you can trigger an action if results are &amp;gt; 0.&lt;/P&gt;&lt;P&gt;index=yourIndex sourcetype=yourSourceType ("START of JobString") earliest=-1d@d&lt;/P&gt;&lt;P&gt;| eval startTime=_time&lt;/P&gt;&lt;P&gt;| eval timeNow=now()&lt;/P&gt;&lt;P&gt;| eval duration = timeNow - startTime&lt;/P&gt;&lt;P&gt;| eval timeStringDuration = strftime(duration, "%H:%M:%S")&lt;/P&gt;&lt;P&gt;| eval timeStringStart = strftime(startTime, "%H:%M:%S")&lt;/P&gt;&lt;P&gt;| eval timeStringNow = strftime(timeNow, "%H:%M:%S")&lt;/P&gt;&lt;P&gt;| where duration &amp;gt; 300&lt;/P&gt;&lt;P&gt;| table startTime, timeStringStart, timeNow, timeStringNow, duration, timeStringDuration&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 12:51:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616311#M214205</guid>
      <dc:creator>sjringo</dc:creator>
      <dc:date>2022-10-07T12:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616329#M214208</link>
      <description>&lt;P&gt;What do you mean the "threshold" time? How are you calculating this?&lt;/P&gt;&lt;P&gt;If a search is configured to run once per hour over 60 mins of data, what would the threshold time be in this case? 60 mins?&lt;/P&gt;&lt;P&gt;And if the search is configured to run once per hour looking over 2 hours of data, is the threshold time still 60 mins?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 14:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616329#M214208</guid>
      <dc:creator>jdunlea</dc:creator>
      <dc:date>2022-10-07T14:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616333#M214209</link>
      <description>&lt;P&gt;The original post said 5 Minutes which is 300 seconds.&lt;/P&gt;&lt;P&gt;Threshold is not a calculated value and does not matter on lookback time ?&lt;/P&gt;&lt;P&gt;Im guessing the assumptions I made are different than yours. Event data would help clarify any of those...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 14:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616333#M214209</guid>
      <dc:creator>sjringo</dc:creator>
      <dc:date>2022-10-07T14:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616437#M214240</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/238212"&gt;@sjringo&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot, seems like it is working, Could you please help me to understand how it works&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance,&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Theja Boddhaluru&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 14:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616437#M214240</guid>
      <dc:creator>thejasplunk67</dc:creator>
      <dc:date>2022-10-08T14:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616440#M214242</link>
      <description>&lt;P&gt;If what I provided is working for you please accept as a solution.&lt;/P&gt;&lt;P&gt;Then you can PM me with any specific questions and I will try my best to explain.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 14:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616440#M214242</guid>
      <dc:creator>sjringo</dc:creator>
      <dc:date>2022-10-08T14:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create an alert for long running jobs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616450#M214248</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;Is there any possibility to send an alert to the user when second time search, I mean we want to skip (To confirm) the first time search alert&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Theja&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 11:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-an-alert-for-long-running-jobs/m-p/616450#M214248</guid>
      <dc:creator>thejasplunk67</dc:creator>
      <dc:date>2022-10-09T11:31:41Z</dc:date>
    </item>
  </channel>
</rss>

