<?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 Access arguments to python script in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230988#M2964</link>
    <description>&lt;P&gt;Hi all, &lt;/P&gt;

&lt;P&gt;I wrote a small python script to run "a script alert action", I access arguments by this follow guide,&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Configuringscriptedalerts#Access_arguments_to_scripts_that_are_run_as_an_alert_action" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Configuringscriptedalerts#Access_arguments_to_scripts_that_are_run_as_an_alert_action&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;My python script is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/python
#
import sys
import serial
import time

tn = sys.argv[4]

print tn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The script is running. &lt;/P&gt;

&lt;P&gt;The arguments to scripts have SPLUNK_ARG_0 -&amp;gt; SPLUNK_ARG_8, but I want access other information,&lt;BR /&gt;
for example: I want to tranfer arguments which is the same tokens $result.fieldname$ in email notifications.&lt;/P&gt;

&lt;P&gt;Please help me, &lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 12:23:45 GMT</pubDate>
    <dc:creator>trungnt</dc:creator>
    <dc:date>2020-09-29T12:23:45Z</dc:date>
    <item>
      <title>Access arguments to python script</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230988#M2964</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;

&lt;P&gt;I wrote a small python script to run "a script alert action", I access arguments by this follow guide,&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Configuringscriptedalerts#Access_arguments_to_scripts_that_are_run_as_an_alert_action" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Configuringscriptedalerts#Access_arguments_to_scripts_that_are_run_as_an_alert_action&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;My python script is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/python
#
import sys
import serial
import time

tn = sys.argv[4]

print tn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The script is running. &lt;/P&gt;

&lt;P&gt;The arguments to scripts have SPLUNK_ARG_0 -&amp;gt; SPLUNK_ARG_8, but I want access other information,&lt;BR /&gt;
for example: I want to tranfer arguments which is the same tokens $result.fieldname$ in email notifications.&lt;/P&gt;

&lt;P&gt;Please help me, &lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:23:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230988#M2964</guid>
      <dc:creator>trungnt</dc:creator>
      <dc:date>2020-09-29T12:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Access arguments to python script</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230989#M2965</link>
      <description>&lt;P&gt;The search results are not directly accessible in the alert script but SPLUNK_ARG_8 argument provides the compressed file that contains the search result. Look at this post for a sample wrapper script on how to use 8th argument to pass search results to your script.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/149836/how-to-run-an-alert-script-on-field-values-generated-in-splunk.html" target="_blank"&gt;https://answers.splunk.com/answers/149836/how-to-run-an-alert-script-on-field-values-generated-in-splunk.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:23:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230989#M2965</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T12:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Access arguments to python script</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230990#M2966</link>
      <description>&lt;P&gt;Hi,  Somesoni2&lt;/P&gt;

&lt;P&gt;Thank you so much for your speedy reply!&lt;BR /&gt;
It 's working.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 06:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Access-arguments-to-python-script/m-p/230990#M2966</guid>
      <dc:creator>trungnt</dc:creator>
      <dc:date>2017-01-18T06:36:35Z</dc:date>
    </item>
  </channel>
</rss>

