<?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: Trying out on custom command search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80533#M20345</link>
    <description>&lt;P&gt;Result is a row, results is all the rows.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2013 07:05:22 GMT</pubDate>
    <dc:creator>jonuwz</dc:creator>
    <dc:date>2013-04-04T07:05:22Z</dc:date>
    <item>
      <title>Trying out on custom command search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80530#M20342</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I've entered "print 'Hello World'" in helloworld.py file for custom command. I also added authorize.conf &amp;amp; commands.conf into $SPLUNK_HOME\etc\system\local\ directory with the stanzas needed and thereafter restarted Splunk. However, when I typed "|helloworld" into the search bar, "Hello World" didnt get printed out onto the screen. What should i do?&lt;/P&gt;

&lt;P&gt;Thanks in advance. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2013 09:41:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80530#M20342</guid>
      <dc:creator>sarahh</dc:creator>
      <dc:date>2013-04-01T09:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trying out on custom command search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80531#M20343</link>
      <description>&lt;P&gt;Take a look in etc/apps/search/bin/gentimes.py  for an example of a "generating" custom command.&lt;/P&gt;

&lt;P&gt;Just putting "print 'Hello World'" into the file is not going to work.&lt;/P&gt;

&lt;P&gt;You need to generate a "results" array containing the field/values for each of the columns, then pass it back.&lt;/P&gt;

&lt;P&gt;helloworld.py&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import re,sys,time, splunk.Intersplunk

def hello(results, settings):
    results = []
    result = {}
    result['string'] = "Hello World"
    results.append(result)
    return results

results, dummyresults, settings = splunk.Intersplunk.getOrganizedResults()
results = hello(results, settings)
splunk.Intersplunk.outputResults(results)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;commands.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[helloworld]
filename = helloworld.py
generating = true
supports_rawargs = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Apr 2013 14:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80531#M20343</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-04-02T14:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trying out on custom command search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80532#M20344</link>
      <description>&lt;P&gt;Oh... why is there "result" and "results"?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 01:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80532#M20344</guid>
      <dc:creator>sarahh</dc:creator>
      <dc:date>2013-04-04T01:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying out on custom command search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80533#M20345</link>
      <description>&lt;P&gt;Result is a row, results is all the rows.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 07:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80533#M20345</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-04-04T07:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trying out on custom command search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80534#M20346</link>
      <description>&lt;P&gt;i see. thanks!! great help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 07:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-out-on-custom-command-search/m-p/80534#M20346</guid>
      <dc:creator>sarahh</dc:creator>
      <dc:date>2013-04-04T07:33:33Z</dc:date>
    </item>
  </channel>
</rss>

