<?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 Whats the point of Custom Python scripts? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21815#M240</link>
    <description>&lt;P&gt;Whats the point of creating a custom script in python for Splunk?&lt;BR /&gt;
I read that you can use it to handle your Splunk search results, but you can already do that via the browser Interface, What else can you do?&lt;/P&gt;

&lt;P&gt;If this is beneficial, where can I find tutorials to help write python scripts for Splunk?&lt;BR /&gt;
by the way, I already know how to program in python.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2011 07:05:44 GMT</pubDate>
    <dc:creator>Dark_Ichigo</dc:creator>
    <dc:date>2011-06-03T07:05:44Z</dc:date>
    <item>
      <title>Whats the point of Custom Python scripts?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21815#M240</link>
      <description>&lt;P&gt;Whats the point of creating a custom script in python for Splunk?&lt;BR /&gt;
I read that you can use it to handle your Splunk search results, but you can already do that via the browser Interface, What else can you do?&lt;/P&gt;

&lt;P&gt;If this is beneficial, where can I find tutorials to help write python scripts for Splunk?&lt;BR /&gt;
by the way, I already know how to program in python.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2011 07:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21815#M240</guid>
      <dc:creator>Dark_Ichigo</dc:creator>
      <dc:date>2011-06-03T07:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Whats the point of Custom Python scripts?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21816#M241</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;If you are talking about python scripts at index time, this is a great feature when Splunk are not able to get the data such as database or application API. You can find lots of information about this on &lt;A href="http://www.splunk.com/base/Documentation/4.2.1/Developer/ScriptSetup"&gt;http://www.splunk.com/base/Documentation/4.2.1/Developer/ScriptSetup&lt;/A&gt; (replace the 4.2.1 with the latest release version or the one you are using)&lt;/P&gt;

&lt;P&gt;If you are talking about the python search command, an idea could be that you could use it when creating a python scripted input and you want to change the input data according to the data already indexed in Splunk. For more information about python search command, have a look at: &lt;A href="http://www.splunk.com/base/Documentation/4.2.1/SearchReference/WriteaPythonsearchcommand"&gt;http://www.splunk.com/base/Documentation/4.2.1/SearchReference/WriteaPythonsearchcommand&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You want to search into Splunk using Python and integrate the result in your third-party application, I would suggest to have a look at the REST API that you will find in teh documentation section.&lt;/P&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Olivier&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2011 08:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21816#M241</guid>
      <dc:creator>OL</dc:creator>
      <dc:date>2011-06-03T08:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Whats the point of Custom Python scripts?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21817#M242</link>
      <description>&lt;P&gt;Thanks, but Do I really need to have a key file and a Wrapper Script?, What files are Mandatory needed? I am currently trying to run the google.py which is a default script I found in the Search/bin Directory, in order to output the results in an output-file to search it via Splunk, My question is after adding the details to the input.conf and commands.conf, How do you actually run the Script?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2011 03:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21817#M242</guid>
      <dc:creator>Dark_Ichigo</dc:creator>
      <dc:date>2011-06-06T03:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Whats the point of Custom Python scripts?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21818#M243</link>
      <description>&lt;P&gt;We're talking about 2 different cases where you could write a script.  The first, when you need to gather data from somewhere that doesn't have a logfile, you use a "scripted input".  That scripted input would be run on an interval, as specified in inputs.conf (i.e. the script provides "input"/data to Splunk).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# inputs.conf
[script://./bin/myscript.sh]
interval = 300
source = myscript
sourcetype = myscript
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With that definition, myscript.sh will run every 5 minutes, and whatever data it prints out will be indexed within Splunk -- as OL said, it's nice for getting data from databases and APIs, etc.&lt;/P&gt;

&lt;P&gt;Now, the second case is when you find that you need an extra feature within the search language that doesn't exist already (e.g. I want to add geolocation data to my events), or is possibly too challenging using standard search commands.  You create a script (these scripts must make calls to Splunk APIs) and a corresponding commands.conf entry:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[geoip]
filename = geoipcmd.py
streaming = true
supports_getinfo=true
maxinputs = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This new command is then available in your searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=firewall src_ip=* | geoip src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jun 2011 12:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21818#M243</guid>
      <dc:creator>mw</dc:creator>
      <dc:date>2011-06-06T12:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Whats the point of Custom Python scripts?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21819#M244</link>
      <description>&lt;P&gt;you run the script by piping your search results to the &lt;CODE&gt;google&lt;/CODE&gt; command.  eg  "foo host=bar | google"&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2011 17:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21819#M244</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-06-06T17:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Whats the point of Custom Python scripts?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21820#M245</link>
      <description>&lt;P&gt;-Thanks a Bunch mw, but after Iv added my script to the input.cong file How do I search for it?&lt;/P&gt;

&lt;P&gt;My Script is a MySql Query script from a Solaris Host, do I have to add this to the input.conf or am I good to go?&lt;/P&gt;

&lt;P&gt;-So your saying that Python and Perl Scripts are only used if I were to add a new Search feature to Splunk?&lt;/P&gt;

&lt;P&gt;-Does Splunk support Python 3.1?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2011 03:26:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Whats-the-point-of-Custom-Python-scripts/m-p/21820#M245</guid>
      <dc:creator>Dark_Ichigo</dc:creator>
      <dc:date>2011-06-09T03:26:45Z</dc:date>
    </item>
  </channel>
</rss>

