<?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 do I get the following import ERROR when I create a custom search command with a Python script? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403587#M6936</link>
    <description>&lt;P&gt;Thank you! That did it! &lt;/P&gt;</description>
    <pubDate>Mon, 01 Oct 2018 20:31:06 GMT</pubDate>
    <dc:creator>aiacobelli</dc:creator>
    <dc:date>2018-10-01T20:31:06Z</dc:date>
    <item>
      <title>Why do I get the following import ERROR when I create a custom search command with a Python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403585#M6934</link>
      <description>&lt;P&gt;Greetings!&lt;/P&gt;

&lt;P&gt;I am writing a Python script to create a custom search command that goes out and reaches out to an API to get some data back based on what is passed to it. Whenever I run the script via  &lt;CODE&gt;/opt/splunk/bin/splunk cmd python splunk.py&lt;/CODE&gt;, I get the following import error: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last):
  File "splunk.py", line 2, in &amp;lt;module&amp;gt;
    import splunk.Intersplunk
  File "/opt/splunk/etc/apps/duoSearch/bin/splunk.py", line 2, in &amp;lt;module&amp;gt;
    import splunk.Intersplunk
ImportError: No module named Intersplunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I open up the interpreter via  &lt;CODE&gt;/opt/splunk/bin/splunk cmd python&lt;/CODE&gt; and try to import it there via &lt;CODE&gt;import splunk.Intersplunk&lt;/CODE&gt; , I do not get an error.  &lt;/P&gt;</description>
      <pubDate>Sat, 29 Sep 2018 18:15:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403585#M6934</guid>
      <dc:creator>aiacobelli</dc:creator>
      <dc:date>2018-09-29T18:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get the following import ERROR when I create a custom search command with a Python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403586#M6935</link>
      <description>&lt;P&gt;Hi @aiacobelli,&lt;/P&gt;

&lt;P&gt;I replicated same issue in my lab environment. Please rename your python file name to something else like &lt;CODE&gt;splunk123.py&lt;/CODE&gt; . Also remove &lt;CODE&gt;splunk.pyc&lt;/CODE&gt; file from directory &lt;CODE&gt;/opt/splunk/etc/apps/duoSearch/bin/&lt;/CODE&gt; and it will work.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Harshil&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 08:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403586#M6935</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-10-01T08:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why do I get the following import ERROR when I create a custom search command with a Python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403587#M6936</link>
      <description>&lt;P&gt;Thank you! That did it! &lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 20:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-do-I-get-the-following-import-ERROR-when-I-create-a-custom/m-p/403587#M6936</guid>
      <dc:creator>aiacobelli</dc:creator>
      <dc:date>2018-10-01T20:31:06Z</dc:date>
    </item>
  </channel>
</rss>

