<?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: REST API with namespace? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9598#M120</link>
    <description>&lt;P&gt;So does the &lt;CODE&gt;namespace&lt;/CODE&gt; parameter in GET or POST just not work or doesn't do what you expect it to do?&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 14:38:59 GMT</pubDate>
    <dc:creator>skawasaki_splun</dc:creator>
    <dc:date>2018-05-10T14:38:59Z</dc:date>
    <item>
      <title>REST API with namespace?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9596#M118</link>
      <description>&lt;P&gt;I have a Search Macro in my Splunk application.  I would like to invoke this Search Macro via REST API.  To do that, I specify the Namespace in my HTTPRequest.  However, the Splunk Server returns an error and indicates that Search Macro is not defined.&lt;/P&gt;

&lt;P&gt;The HTTPRequest:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;POST &lt;A href="https://splunkserver.local:8089/services/search/jobs" target="test_blank"&gt;https://splunkserver.local:8089/services/search/jobs&lt;/A&gt;   
namespace = MyApp
search = search `MyMarco(foo1,01/13/2010:00:00:00,01/16/2010:00:00:00)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I change the permission of the Search Macro to Global and don't set the Namespace, it works as expected.&lt;/P&gt;

&lt;P&gt;Thus, my question is how to set the namespace?  According to my understanding on the namespace setting in the REST API, this should work.  Do you have any example of the REST API with namespace?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 00:42:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9596#M118</guid>
      <dc:creator>Mick</dc:creator>
      <dc:date>2010-02-04T00:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: REST API with namespace?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9597#M119</link>
      <description>&lt;P&gt;The proper way to post a search job to a specific namespace is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://splunkserver:8089/servicesNS/YOUR_USERNAME/TARGET_NAMESPACE/search/jobs" target="test_blank"&gt;https://splunkserver:8089/servicesNS/YOUR_USERNAME/TARGET_NAMESPACE/search/jobs&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The difference between this URI and the original is that the root path segment:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;/servicesNS/&lt;/CODE&gt; vs &lt;CODE&gt;/services/&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;which switches the server into namespace-aware mode. In your example, replace &lt;CODE&gt;TARGET_NAMESPACE&lt;/CODE&gt; with &lt;CODE&gt;MyApp&lt;/CODE&gt;, and &lt;CODE&gt;YOUR_USERNAME&lt;/CODE&gt; with whatever identity you want to own the search job.  The &lt;CODE&gt;namespace&lt;/CODE&gt; POST parameter is not used.&lt;/P&gt;

&lt;P&gt;Also, the search macro you define must be accessible by &lt;CODE&gt;YOUR_USERNAME&lt;/CODE&gt;, so if you want to share this search job with others, make sure that the search macro is shared within the app.  If this is to a completely private search, then just ensure that the search macro is owned by the same user as &lt;CODE&gt;YOUR_USERNAME&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 03:01:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9597#M119</guid>
      <dc:creator>Johnvey</dc:creator>
      <dc:date>2010-02-04T03:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: REST API with namespace?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9598#M120</link>
      <description>&lt;P&gt;So does the &lt;CODE&gt;namespace&lt;/CODE&gt; parameter in GET or POST just not work or doesn't do what you expect it to do?&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 14:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/REST-API-with-namespace/m-p/9598#M120</guid>
      <dc:creator>skawasaki_splun</dc:creator>
      <dc:date>2018-05-10T14:38:59Z</dc:date>
    </item>
  </channel>
</rss>

