<?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: Running external script from search in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27200#M4530</link>
    <description>&lt;P&gt;I've not used the "script" command before, but I do use external scripts as custom commands. This involves setting up the "commands.conf" file. &lt;/P&gt;

&lt;P&gt;Your script should live within the "bin" directory of your app, e.g. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;appName&amp;gt;/bin/&lt;/CODE&gt;, you should then add something like the following to the app's "local" directory...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[exampleCommand]
filename = script.pl
type = perl
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then call the script in Splunk like the following assuming you have 2 arguments.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;*| exampleCommand arg1 arg2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 07 Aug 2012 12:09:55 GMT</pubDate>
    <dc:creator>MHibbin</dc:creator>
    <dc:date>2012-08-07T12:09:55Z</dc:date>
    <item>
      <title>Running external script from search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27199#M4529</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to generate events through an external script from the search, using the &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.3/SearchReference/Script"&gt;script command&lt;/A&gt;. Splunk says the command does not exist in commands.conf. However, the documentation for the script command doesn't say that the script needs to exist in commands.conf. Is this just a simple omission, or am I doing something wrong?&lt;/P&gt;

&lt;P&gt;This is what I'm trying to do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| script perl foo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Aug 2012 07:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27199#M4529</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-08-07T07:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Running external script from search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27200#M4530</link>
      <description>&lt;P&gt;I've not used the "script" command before, but I do use external scripts as custom commands. This involves setting up the "commands.conf" file. &lt;/P&gt;

&lt;P&gt;Your script should live within the "bin" directory of your app, e.g. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;appName&amp;gt;/bin/&lt;/CODE&gt;, you should then add something like the following to the app's "local" directory...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[exampleCommand]
filename = script.pl
type = perl
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then call the script in Splunk like the following assuming you have 2 arguments.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;*| exampleCommand arg1 arg2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Aug 2012 12:09:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27200#M4530</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-08-07T12:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Running external script from search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27201#M4531</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Yes, this is pretty much what is described in the documentation about custom commands in the documentation. The documentation for the script command led me to believe you can avoid editing commands.conf.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2012 12:56:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27201#M4531</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-08-07T12:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Running external script from search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27202#M4532</link>
      <description>&lt;P&gt;How the script command is supposed to be used is still a bit unclear to me, but editing commands.conf certainly works.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2012 08:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27202#M4532</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-08-13T08:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Running external script from search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27203#M4533</link>
      <description>&lt;P&gt;Sorry I couldn't help on the command itself, but good job on getting a solution working.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2012 18:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27203#M4533</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-08-13T18:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Running external script from search</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27204#M4534</link>
      <description>&lt;P&gt;According to &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Script" target="_blank"&gt;the documentation for the script command&lt;/A&gt; you can't use script like you are thinking.&lt;/P&gt;

&lt;P&gt;script calls an external &lt;STRONG&gt;python&lt;/STRONG&gt; program that can modify or generate search results. Scripts must be declared in the commands.conf file and be located in the $SPLUNK_HOME/etc/apps//bin/ directory. The script is executed using $SPLUNK_HOME/bin/python&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Running-external-script-from-search/m-p/27204#M4534</guid>
      <dc:creator>brettcarroll</dc:creator>
      <dc:date>2020-09-29T17:43:43Z</dc:date>
    </item>
  </channel>
</rss>

