<?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: Creating custom Commands- Splunk [5.0.2] in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79273#M1130</link>
    <description>&lt;P&gt;Concerning local vs default, put the .conf in default. You're the creator of the app, so you provide the default configuration. The user of your app can then override things in local if he needs to.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2013 17:20:49 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-06-28T17:20:49Z</dc:date>
    <item>
      <title>Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79270#M1127</link>
      <description>&lt;P&gt;I'm trying to make a custom Command using python but I'm running into some errors.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Error in 'script': Getinfo probe failed for external search command 'testscript'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For the moment I'm just trying to figure out how to get &lt;EM&gt;any&lt;/EM&gt; script to work, which is proving more difficult that I anticipated. &lt;/P&gt;

&lt;P&gt;How I created the app and command:&lt;/P&gt;

&lt;P&gt;So, I created a test app called "TestCommands" using the sample_app template.&lt;BR /&gt;
Then, I created a dummy script called "testcommand.py" in the bin folder within that app.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
import csv
import splunk.Intersplunk

while True:
    line = sys.stdin.readline()
    if not line.strip(): break

reader = csv.DictReader( sys.stdin )
headers = reader.fieldnames
writer = csv.DictWriter( sys.stdout, headers )
writer.writer.writerows( headers )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(From what I understand, this should just output the headers back to splunk)&lt;/P&gt;

&lt;P&gt;I also have a commands.conf located in the default &lt;STRONG&gt;and&lt;/STRONG&gt; local folders of the apps. (The directions were unclear as to which of these i should put it in) Both of those contain the same information: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[testscript]
filename = testcommand.py
streaming = true
supports_getinfo=true
maxinputs = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Search is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="pathname\dummydata.csv" | testscript" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have checked that the data source isn't the problem. &lt;BR /&gt;
Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 14:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79270#M1127</guid>
      <dc:creator>Stephen93Marsh</dc:creator>
      <dc:date>2013-06-28T14:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79271#M1128</link>
      <description>&lt;P&gt;Your command does not do anything that appears to support getinfo and the error message mentions the same, so I suggest turning that off in commands.conf.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 16:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79271#M1128</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-06-28T16:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79272#M1129</link>
      <description>&lt;P&gt;After trying this, it just says "Unknown search command" &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 17:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79272#M1129</guid>
      <dc:creator>Stephen93Marsh</dc:creator>
      <dc:date>2013-06-28T17:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79273#M1130</link>
      <description>&lt;P&gt;Concerning local vs default, put the .conf in default. You're the creator of the app, so you provide the default configuration. The user of your app can then override things in local if he needs to.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 17:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79273#M1130</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-06-28T17:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79274#M1131</link>
      <description>&lt;P&gt;Maybe you could start by copying one of the commands in the search app. uniq.py a very basic example.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 22:17:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79274#M1131</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2013-06-28T22:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79275#M1132</link>
      <description>&lt;P&gt;I'll try that Chris. If I start basic enough, its bound to work. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2013 15:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79275#M1132</guid>
      <dc:creator>Stephen93Marsh</dc:creator>
      <dc:date>2013-07-01T15:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom Commands- Splunk [5.0.2]</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79276#M1133</link>
      <description>&lt;P&gt;I had this issue when upgrading my python SDK of my app to version 1.3.0 (from 1.2.3). The solution was to add at the beginning of my script the following lines (as it is the case in the new examples):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys

from splunklib.searchcommands import \
    dispatch, StreamingCommand, Configuration, Option, validators
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it might help others &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2014 08:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-custom-Commands-Splunk-5-0-2/m-p/79276#M1133</guid>
      <dc:creator>OL</dc:creator>
      <dc:date>2014-12-18T08:43:11Z</dc:date>
    </item>
  </channel>
</rss>

