<?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 to configure custom alert for run python script in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376614#M6669</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have some problem with run python script in custom alert. I have the next file&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;alert_actions.conf&lt;/STRONG&gt;&lt;BR /&gt;
[DigitalTwingKeepwareCRC]&lt;BR /&gt;
is_custom = 1&lt;BR /&gt;
label = "Monitoreo de molino de Rio Claro"&lt;BR /&gt;
description = "Ejecuta acciones sobre el molino de Rio Claro"&lt;BR /&gt;
payload_format = json&lt;BR /&gt;
param.result_count = $job.resultCount$&lt;BR /&gt;
param.search_query = $job.search$&lt;BR /&gt;
param.results = results_link&lt;BR /&gt;
alert.execute.cmd = python&lt;BR /&gt;
alert.execute.cmd.arg.0 = $SPLUNK_HOME$/etc/apps/DTw_CRC/bin/iotgateway/test.py&lt;BR /&gt;
alert.execute.cmd.arg.1 = --execute&lt;/P&gt;

&lt;P&gt;but in the &lt;CODE&gt;_internal&lt;/CODE&gt; index I get the next event&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt; ERROR sendmodalert - action=DigitalTwingKeepwareCRC - Failed to find alert.execute.cmd "python".&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Please, help me&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:50:26 GMT</pubDate>
    <dc:creator>jacruzs</dc:creator>
    <dc:date>2020-09-29T23:50:26Z</dc:date>
    <item>
      <title>How to configure custom alert for run python script</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376614#M6669</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have some problem with run python script in custom alert. I have the next file&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;alert_actions.conf&lt;/STRONG&gt;&lt;BR /&gt;
[DigitalTwingKeepwareCRC]&lt;BR /&gt;
is_custom = 1&lt;BR /&gt;
label = "Monitoreo de molino de Rio Claro"&lt;BR /&gt;
description = "Ejecuta acciones sobre el molino de Rio Claro"&lt;BR /&gt;
payload_format = json&lt;BR /&gt;
param.result_count = $job.resultCount$&lt;BR /&gt;
param.search_query = $job.search$&lt;BR /&gt;
param.results = results_link&lt;BR /&gt;
alert.execute.cmd = python&lt;BR /&gt;
alert.execute.cmd.arg.0 = $SPLUNK_HOME$/etc/apps/DTw_CRC/bin/iotgateway/test.py&lt;BR /&gt;
alert.execute.cmd.arg.1 = --execute&lt;/P&gt;

&lt;P&gt;but in the &lt;CODE&gt;_internal&lt;/CODE&gt; index I get the next event&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt; ERROR sendmodalert - action=DigitalTwingKeepwareCRC - Failed to find alert.execute.cmd "python".&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Please, help me&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376614#M6669</guid>
      <dc:creator>jacruzs</dc:creator>
      <dc:date>2020-09-29T23:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure custom alert for run python script</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376615#M6670</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In &lt;CODE&gt;alert.execute.cmd&lt;/CODE&gt; you need to provide &lt;CODE&gt;*.path&lt;/CODE&gt; file.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Create &lt;CODE&gt;$SPLUNK_HOME$/etc/apps/DTw_CRC/linux_x86_64/bin/&lt;/CODE&gt;directory.&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Create &lt;CODE&gt;python.path&lt;/CODE&gt; file with below config and provide execute permission with &lt;CODE&gt;chmod 750 python.path&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;"$SPLUNK_HOME/bin/splunk" cmd python&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Use below config in alert_actions.conf&lt;BR /&gt;
[DigitalTwingKeepwareCRC]&lt;BR /&gt;
is_custom = 1&lt;BR /&gt;
label = "Monitoreo de molino de Rio Claro"&lt;BR /&gt;
description = "Ejecuta acciones sobre el molino de Rio Claro"&lt;BR /&gt;
payload_format = json&lt;BR /&gt;
param.result_count = $job.resultCount$&lt;BR /&gt;
param.search_query = $job.search$&lt;BR /&gt;
param.results = results_link&lt;BR /&gt;
alert.execute.cmd = python.path&lt;BR /&gt;
alert.execute.cmd.arg.0 = $SPLUNK_HOME$/etc/apps/DTw_CRC/bin/iotgateway/test.py&lt;BR /&gt;
alert.execute.cmd.arg.1 = --execute&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376615#M6670</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2020-09-29T23:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure custom alert for run python script</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376616#M6671</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I created &lt;CODE&gt;$SPLUNK_HOME$/etc/apps/DTw_CRC/linux_x86_64/bin/&lt;/CODE&gt; directory.&lt;/P&gt;

&lt;P&gt;In the last location, I created python.path file, and in this file write &lt;CODE&gt;"$SPLUNK_HOME/bin/splunk" cmd python&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I edited &lt;STRONG&gt;alert_actions.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;But I get the next error:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;04-01-2019 13:05:01.910  0000 ERROR sendmodalert - action=DigitalTwingKeepwareCRC - Failed to find alert.execute.cmd "python.path".&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What's my error?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376616#M6671</guid>
      <dc:creator>jacruzs</dc:creator>
      <dc:date>2020-09-29T23:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure custom alert for run python script</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376617#M6672</link>
      <description>&lt;P&gt;I have tested above config in my lab and failed but below config is working fine.&lt;/P&gt;

&lt;P&gt;Please change &lt;CODE&gt;$SPLUNK_HOME$/etc/apps/DTw_CRC/linux_x86_64/bin/python.path&lt;/CODE&gt; with below config&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME/bin/python
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Add below config in &lt;CODE&gt;$SPLUNK_HOME$/etc/apps/DTw_CRC/metadata/default.meta&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[alert_actions/DigitalTwingKeepwareCRC]
access = read : [ * ], write : [ admin ]
export = system
owner = nobody
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Apr 2019 19:41:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-custom-alert-for-run-python-script/m-p/376617#M6672</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-01T19:41:58Z</dc:date>
    </item>
  </channel>
</rss>

