<?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: Run a script from an alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382415#M6737</link>
    <description>&lt;P&gt;Hi @manalhadrach ,&lt;/P&gt;

&lt;P&gt;You can check error of script by running below query.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index="_internal" "cpu.sh"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Bhavik&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jan 2019 13:40:21 GMT</pubDate>
    <dc:creator>bhavikbhalodia</dc:creator>
    <dc:date>2019-01-15T13:40:21Z</dc:date>
    <item>
      <title>Run a script from an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382413#M6735</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;I need your help please.&lt;BR /&gt;
I am trying to run the same script from an alert.&lt;BR /&gt;
My script is in : /apps/my_app/bin/scripts/my_script.sh &lt;BR /&gt;
I changed the permissions (everyone can read, write and execute the script) and the owner is splunk. &lt;BR /&gt;
My log file is in  /apps/my_app/bin/scripts/log_file.log  (everyone can read, write and execute the log file)  and the owner is splunk. &lt;/P&gt;

&lt;P&gt;The sh script is : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   DATE=`date '+%Y/%m/%d'`
   echo $DATE  &amp;gt;&amp;gt; /srv/opt/splunk/etc/apps/my_app/bin/scripts/log_file.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Nothing happens, my file (log_file.log) is not modified, and II don't know where can I check the erros or problems due to the execution of the script from the alert.&lt;BR /&gt;
First question : Where can we check the logs of the execution of the alert (if the script is running or if there is a problem)?&lt;BR /&gt;
Second question: Is there something I should do enable running a script from an alert ? Can someone explain the steps we need to do to make the alert run the script ?&lt;/P&gt;

&lt;P&gt;PS : I've already read the splunk doc.&lt;/P&gt;

&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:32:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382413#M6735</guid>
      <dc:creator>manalhadrach</dc:creator>
      <dc:date>2020-09-29T22:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script from an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382414#M6736</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;After creating script, you need to configure that script in Schedule Search, have a look at this document &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/Alert/Runscriptaction"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.3/Alert/Runscriptaction&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Additionally &lt;CODE&gt;Run a Script&lt;/CODE&gt;  alert action is officially deprecated. It has been replaced with custom alert actions as a more scalable and robust framework for integrating custom actions. See &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/AdvancedDev/ModAlertsIntro"&gt;About custom alert actions&lt;/A&gt; for implementation and migration information. &lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 14:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382414#M6736</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-12-28T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script from an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382415#M6737</link>
      <description>&lt;P&gt;Hi @manalhadrach ,&lt;/P&gt;

&lt;P&gt;You can check error of script by running below query.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index="_internal" "cpu.sh"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Bhavik&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 13:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/382415#M6737</guid>
      <dc:creator>bhavikbhalodia</dc:creator>
      <dc:date>2019-01-15T13:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script from an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/683488#M15887</link>
      <description>&lt;P&gt;I have requirement and am not sure if i can achieve this through this method. For example if i create an Search whihc is not logging or down, and can i create a run a custom script to check by telnetting or ping for the results came from search? Is this possible? How i can pass the values of the hostnames to the script?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 11:49:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/683488#M15887</guid>
      <dc:creator>rajashaey</dc:creator>
      <dc:date>2024-04-06T11:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script from an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/683490#M15888</link>
      <description>&lt;P&gt;1. This is a very old thread. You have a new problem, possibly only partially (if at all) connected to the original question. Please create a new thread describing your goal and what you tried so far.&lt;/P&gt;&lt;P&gt;2. Speaking of "what you tried so far" - have you checked the docs? Have you tried doing anything on your own yet?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 13:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Run-a-script-from-an-alert/m-p/683490#M15888</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-04-06T13:28:28Z</dc:date>
    </item>
  </channel>
</rss>

