<?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: Why am I getting error &amp;quot;No module named splunklib.searchcommands&amp;quot; trying to run a custom search command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264260#M79344</link>
    <description>&lt;P&gt;i downloaded Python splunk sdk using PIP and setup tools. then I added the path to Pythonpah as well and copied the files to app-&amp;gt; bin folder&lt;BR /&gt;
But the problem is still there&lt;/P&gt;</description>
    <pubDate>Tue, 22 May 2018 09:51:03 GMT</pubDate>
    <dc:creator>Chandras11</dc:creator>
    <dc:date>2018-05-22T09:51:03Z</dc:date>
    <item>
      <title>Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264253#M79337</link>
      <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;

&lt;P&gt;Been struggling with this for hours now, when trying to run a custom search command I get: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "generatehello.py", line 2, in &amp;lt;module&amp;gt;
    from splunklib.searchcommands import \
ImportError: No module named splunklib.searchcommands
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried to make sure I had the Python SDK installed which I thought I did, but upon attempting that I get: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last):
  File "setup.py", line 17, in &amp;lt;module&amp;gt;
    from setuptools import setup, Command
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So really confused at this point how to set this thing up. I have seem all sorts of stuff about PYTHONPATH and setting that up, but it's been pretty unclear. To run Splunks bundled Python, I have been using the command: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"/apps/splunk/bin/splunk cmd python &amp;lt;pythonfile.py&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not sure if that is correct either. Could really use some guidance. Everything has been pretty confusing so far. I have had my $SPLUNK_HOME set to &lt;CODE&gt;/apps/splunk&lt;/CODE&gt; as well.&lt;/P&gt;

&lt;P&gt;I had gotten it running on 2.6, but unfortunately, the search command contains some method that was not added until 2.7 so I wasn't able to use it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 18:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264253#M79337</guid>
      <dc:creator>joseph_caraccio</dc:creator>
      <dc:date>2016-07-18T18:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264254#M79338</link>
      <description>&lt;P&gt;Yeah, the example for creating custom commands is very dated, and needs to be updated - badly.   Could use some help here...&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 21:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264254#M79338</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2016-07-18T21:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264255#M79339</link>
      <description>&lt;P&gt;Which example are you referring to? If you throw me a link I can ask to have that updated in parallel to this.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 19:17:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264255#M79339</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2016-07-19T19:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264256#M79340</link>
      <description>&lt;P&gt;Did you throw the &lt;CODE&gt;splunklib&lt;/CODE&gt; folder under the app's &lt;CODE&gt;bin&lt;/CODE&gt; dir? Also, did you put the proper &lt;CODE&gt;import splunklib.client as client&lt;/CODE&gt; in your file? Lastly, do you have the corresponding config for the new command in place?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 19:24:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264256#M79340</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2016-07-19T19:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264257#M79341</link>
      <description>&lt;P&gt;Thread has been started with @sloshburch and our docs team. Hopefully we'll get this cleaned up in short order, but I think this whole dev section is getting a major revamp, so changes may not be pushed out until next major release.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 15:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264257#M79341</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2016-07-20T15:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264258#M79342</link>
      <description>&lt;P&gt;@joseph_caraccio are you using v1 or v2 of the custom search command API? See description of the options here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.2/Search/Aboutcustomsearchcommands"&gt;About Custom Search Commands&lt;/A&gt;. You should use v2.&lt;/P&gt;

&lt;P&gt;If you are using the Splunk-bundled interpreter, then you don't have to ship the SDK. If you use a system or other interpreter, you must use a .path file to call it correctly. A shebang won't work. And if going this route, you also must also install the Splunk SDK system-wide or package it in your app's folder like any Python module.&lt;/P&gt;

&lt;P&gt;Lastly, "splunk cmd python" is a great troubleshooting tool, but only works if using the embedded Python.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 15:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264258#M79342</guid>
      <dc:creator>halr9000</dc:creator>
      <dc:date>2016-07-20T15:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264259#M79343</link>
      <description>&lt;P&gt;Did you throw the splunklib folder under the app's bin dir? - Where can I find the splunklib folder and is there cmd execution for it or the copy paste suffice? &lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 08:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264259#M79343</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-05-22T08:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264260#M79344</link>
      <description>&lt;P&gt;i downloaded Python splunk sdk using PIP and setup tools. then I added the path to Pythonpah as well and copied the files to app-&amp;gt; bin folder&lt;BR /&gt;
But the problem is still there&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 09:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264260#M79344</guid>
      <dc:creator>Chandras11</dc:creator>
      <dc:date>2018-05-22T09:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting error "No module named splunklib.searchcommands" trying to run a custom search command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264261#M79345</link>
      <description>&lt;P&gt;This is nearly two years old and the SDK likely has come along way since then. I would recommend starting a new question post and point out the dev.splunk.com instructions you followed and where it failed. That way an answer can be provided that caters to the place you got stuck using the version of the SDK available today. Feel free to cross post the link to the new thread here.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 19:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-error-quot-No-module-named-splunklib/m-p/264261#M79345</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2018-05-23T19:55:09Z</dc:date>
    </item>
  </channel>
</rss>

