<?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 Linux shell script with Alert Action in the standard Search app. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Run-a-Linux-shell-script-with-Alert-Action-in-the-standard/m-p/460656#M79523</link>
    <description>&lt;P&gt;First off, DO NOT edit in etc/apps/search/default, it will get overwritten on update of splunk, instead use local: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/Configurationfiledirectories#About_the_default_files"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/Configurationfiledirectories#About_the_default_files&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;That being said, you can call scripts using the Run a script alert action: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Alert/Runscriptaction"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Alert/Runscriptaction&lt;/A&gt; or by properly implementing a custom alert using the Modular Alert framework: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/AdvancedDev/ModAlertsIntro"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/AdvancedDev/ModAlertsIntro&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Mar 2020 00:15:28 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2020-03-28T00:15:28Z</dc:date>
    <item>
      <title>Run a Linux shell script with Alert Action in the standard Search app.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Run-a-Linux-shell-script-with-Alert-Action-in-the-standard/m-p/460655#M79522</link>
      <description>&lt;P&gt;I am running version 8.x. I want to add the capability to run a custom Linux bash script as Alert Action with the OOTB search app. I did the following:&lt;/P&gt;

&lt;P&gt;1 - create a file called alert_actions.conf in the /opt/splunk/etc/apps/search/default directory and have the following content.&lt;BR /&gt;
[sendsnmptrap]&lt;BR /&gt;
is_custom = 1&lt;BR /&gt;
label = Send SNMP Traps&lt;BR /&gt;
description = Custom action to send search result as SNMP traps&lt;BR /&gt;
ttl = 120&lt;BR /&gt;
disabled = 0&lt;/P&gt;

&lt;P&gt;----how can I call the script?&lt;/P&gt;

&lt;P&gt;2 - I create the script in as /opt/splunk/etc/apps/search/bin/sendsnmptrap.sh with the very basic command &amp;amp; parameter&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Run-a-Linux-shell-script-with-Alert-Action-in-the-standard/m-p/460655#M79522</guid>
      <dc:creator>konpa01</dc:creator>
      <dc:date>2020-09-30T04:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Run a Linux shell script with Alert Action in the standard Search app.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Run-a-Linux-shell-script-with-Alert-Action-in-the-standard/m-p/460656#M79523</link>
      <description>&lt;P&gt;First off, DO NOT edit in etc/apps/search/default, it will get overwritten on update of splunk, instead use local: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/Configurationfiledirectories#About_the_default_files"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/Configurationfiledirectories#About_the_default_files&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;That being said, you can call scripts using the Run a script alert action: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Alert/Runscriptaction"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Alert/Runscriptaction&lt;/A&gt; or by properly implementing a custom alert using the Modular Alert framework: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/AdvancedDev/ModAlertsIntro"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/AdvancedDev/ModAlertsIntro&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 00:15:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Run-a-Linux-shell-script-with-Alert-Action-in-the-standard/m-p/460656#M79523</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2020-03-28T00:15:28Z</dc:date>
    </item>
  </channel>
</rss>

