<?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: Is there a time limit on saved search scripts? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44409#M552</link>
    <description>&lt;P&gt;I don't know if this problem relevant yet but I had the same problem. Splunk support found an undocumented paramater for this in savedseaches.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action.script.maxtime
The maximum amount of time a script action takes before the action is canceled. The valid format is number followed by a time unit ("s", "m", "h", or "d").
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope it helps.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2019 13:29:50 GMT</pubDate>
    <dc:creator>nembela</dc:creator>
    <dc:date>2019-04-17T13:29:50Z</dc:date>
    <item>
      <title>Is there a time limit on saved search scripts?</title>
      <link>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44406#M549</link>
      <description>&lt;P&gt;I've got a splunk saved search configured to run an external script when number of events &amp;gt; 0. Are there any limits on how long the external script can take to run before being killed by splunk? The script simply processes the search results and updates a external datastore. The script can take between 1 seconds and 6 minutes to run, depending upon the number of events and how busy the server is. I'm seeing the following messages ocasionally in the splunkd.log&lt;/P&gt;
&lt;P&gt;01-02-2012 02:20:33.824 -0800 WARN ScriptRunner - Killing script, probably timed out, grace=5sec, script="/local/mnt/workspace/splunk/etc/apps/search/bin/runshellscript.py"&lt;/P&gt;
&lt;P&gt;01-02-2012 02:20:33.827 -0800 ERROR script - Script execution failed for external search command 'runshellscript'&lt;/P&gt;
&lt;P&gt;Is there really a grace limit of 5 seconds? If so, any way to increase the timeout and allow the script to complete?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 21:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44406#M549</guid>
      <dc:creator>heybigben</dc:creator>
      <dc:date>2020-06-09T21:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a time limit on saved search scripts?</title>
      <link>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44407#M550</link>
      <description>&lt;P&gt;Looking at &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Savedsearchesconf"&gt;savedsearches.conf&lt;/A&gt;, I do not see any parameters that would allow to configure a timeout period for a scripted alert. As it is, it seems that unfortunately the script execution timeout period is hard-coded at 5 minutes with a grace period of 5 seconds.&lt;/P&gt;

&lt;P&gt;If you would like this to be configurable, I would suggest that you submit an enhancement request by &lt;A href="http://www.splunk.com/index.php/submit_issue"&gt;opening a support case&lt;/A&gt; explaining your use-case and the desired added functionality.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2012 05:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44407#M550</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2012-01-10T05:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a time limit on saved search scripts?</title>
      <link>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44408#M551</link>
      <description>&lt;P&gt;In lieu of being able to configure the timeout value for the fired script , you could perhaps create a solution using the Splunk REST API.&lt;/P&gt;

&lt;P&gt;ie:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;write a python script that is cron triggered.&lt;/LI&gt;
&lt;LI&gt;python script uses the &lt;A href="http://dev.splunk.com/view/splunk-python-sdk/SP-CAAAEBB"&gt;Splunk Python SDK&lt;/A&gt; to execute your search&lt;/LI&gt;
&lt;LI&gt;then proceed with your existing logic if search returns "events &amp;gt; 0"&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 10 Jan 2012 06:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44408#M551</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2012-01-10T06:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a time limit on saved search scripts?</title>
      <link>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44409#M552</link>
      <description>&lt;P&gt;I don't know if this problem relevant yet but I had the same problem. Splunk support found an undocumented paramater for this in savedseaches.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action.script.maxtime
The maximum amount of time a script action takes before the action is canceled. The valid format is number followed by a time unit ("s", "m", "h", or "d").
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 13:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44409#M552</guid>
      <dc:creator>nembela</dc:creator>
      <dc:date>2019-04-17T13:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a time limit on saved search scripts?</title>
      <link>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44410#M553</link>
      <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/653458/max-time-spent-in-per-result-alerts-issue.html" target="_blank"&gt;https://answers.splunk.com/answers/653458/max-time-spent-in-per-result-alerts-issue.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;limits.conf&lt;/P&gt;

&lt;P&gt;[scheduler]&lt;BR /&gt;
 action_execution_threads = 10&lt;BR /&gt;
 actions_queue_size = 10000&lt;BR /&gt;
 max_per_result_alerts =10000&lt;BR /&gt;
 max_per_result_alerts_time = 600&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Is-there-a-time-limit-on-saved-search-scripts/m-p/44410#M553</guid>
      <dc:creator>chandanjaisal</dc:creator>
      <dc:date>2020-09-30T05:16:29Z</dc:date>
    </item>
  </channel>
</rss>

