<?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 How to use `import mysplunksearch` instead of `$splunk cmd python myslplunksearch`? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-use-import-mysplunksearch-instead-of-splunk-cmd-python/m-p/48118#M633</link>
    <description>&lt;P&gt;On the same machine that I am running Splunk, I want to integrate python splunk search results inside python code outside of the Splunk directory. &lt;/P&gt;

&lt;P&gt;For example inside Splunk directory we can do the following (&lt;A href="http://splunk-base.splunk.com/answers/14/can-i-use-splunks-built-in-python-sdk-in-my-own-scripts"&gt;splunkbase source&lt;/A&gt;) :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ splunk cmd python my_searcher.py 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I now extend this to outside without needing to use &lt;CODE&gt;splunk cmd&lt;/CODE&gt;, for example, I would like to import my new splunk search module into other python code using this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; import my_searcher
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Aug 2012 23:02:54 GMT</pubDate>
    <dc:creator>boris</dc:creator>
    <dc:date>2012-08-30T23:02:54Z</dc:date>
    <item>
      <title>How to use `import mysplunksearch` instead of `$splunk cmd python myslplunksearch`?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-use-import-mysplunksearch-instead-of-splunk-cmd-python/m-p/48118#M633</link>
      <description>&lt;P&gt;On the same machine that I am running Splunk, I want to integrate python splunk search results inside python code outside of the Splunk directory. &lt;/P&gt;

&lt;P&gt;For example inside Splunk directory we can do the following (&lt;A href="http://splunk-base.splunk.com/answers/14/can-i-use-splunks-built-in-python-sdk-in-my-own-scripts"&gt;splunkbase source&lt;/A&gt;) :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ splunk cmd python my_searcher.py 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I now extend this to outside without needing to use &lt;CODE&gt;splunk cmd&lt;/CODE&gt;, for example, I would like to import my new splunk search module into other python code using this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; import my_searcher
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Aug 2012 23:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-use-import-mysplunksearch-instead-of-splunk-cmd-python/m-p/48118#M633</guid>
      <dc:creator>boris</dc:creator>
      <dc:date>2012-08-30T23:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use `import mysplunksearch` instead of `$splunk cmd python myslplunksearch`?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-use-import-mysplunksearch-instead-of-splunk-cmd-python/m-p/48119#M634</link>
      <description>&lt;P&gt;You should probably be using the Splunk Python SDK, instead of calling the command-line utilities.&lt;/P&gt;

&lt;P&gt;See: &lt;A href="http://dev.splunk.com/view/python-sdk/SP-CAAAEBB"&gt;http://dev.splunk.com/view/python-sdk/SP-CAAAEBB&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2012 00:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-use-import-mysplunksearch-instead-of-splunk-cmd-python/m-p/48119#M634</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-08-31T00:12:34Z</dc:date>
    </item>
  </channel>
</rss>

