<?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: How do use the Splunk REST API to update macros that live under a different app? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-use-the-Splunk-REST-API-to-update-macros-that-live-under/m-p/684675#M114227</link>
    <description>&lt;P&gt;Check some of the app permissions settings using the below, this may help troubleshoot - it sounds like a permissions issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rest splunk_server=local servicesNS/nobody/search/configs/conf-macros
| search eai:acl.app=my_new_app&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 18 Apr 2024 15:58:44 GMT</pubDate>
    <dc:creator>deepakc</dc:creator>
    <dc:date>2024-04-18T15:58:44Z</dc:date>
    <item>
      <title>How do use the Splunk REST API to update macros that live under a different app?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-use-the-Splunk-REST-API-to-update-macros-that-live-under/m-p/684669#M114224</link>
      <description>&lt;P&gt;Hiya, I'm trying to use the Splunk REST API to update macros that I've recently had to move to live under a different app that isn't the default `search` app.&lt;BR /&gt;&lt;BR /&gt;Before when the macro lived in the `search` app I was able to make a POST request to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;/servicesNS/&amp;lt;account&amp;gt;/search/admin/macros/&amp;lt;macroName&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;elif search_or_macro == 'macros':
    url = '&amp;lt;ROOT&amp;gt;/servicesNS/&amp;lt;ACCOUNT&amp;gt;/search/admin/macros/{}'.format(macro_name)
    res = requests.post(url, headers=headers, data={'definition': r'{}'.format(macro_definition)})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However once I moved the macros to live under a new app, let's call it `my_new_app`, POST requests no longer work to update the macro. This is what I have currently:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;elif search_or_macro == 'macros':
  url = '&amp;lt;ROOT&amp;gt;/servicesNS/nobody/my_new_app/admin/macros/{}'.format(macro_name)
  res = requests.post(url, headers=headers, data={'definition': r'{}'.format(macro_definition)})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried replacing `nobody` with:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;admin&lt;/LI&gt;&lt;LI&gt;the account that owns the macro&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However neither of these work.&lt;/P&gt;&lt;P&gt;I used the following splunk command to verify that the endpoint does seem to exist:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /servicesNS/&amp;lt;ACCOUNT&amp;gt;/my_new_app/admin/macros/&amp;lt;MACRO NAME&amp;gt;
| search author=&amp;lt;ACCOUNT&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And when I run that I get the following `id`:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://127.0.0.1:8089/servicesNS/nobody/my_new_app/admin/macros/&amp;lt;MACRO NAME&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;I have also read through the REST API documentation here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.3/RESTTUT/RESTbasicexamples" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.3/RESTTUT/RESTbasicexamples&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.3/RESTUM/RESTusing#Namespace" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.3/RESTUM/RESTusing#Namespace&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.3/RESTUM/RESTusing" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.3/RESTUM/RESTusing&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However none of these explicitly describe how to update macros, and all I can seem to find when googling are old posts from 2015-2019 that weren't applicable to what I am trying to achieve&lt;/P&gt;&lt;P&gt;Any help here would greatly be appreciated, I feel like I'm missing something simple but can't find further documentation that applies to macros&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 15:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-use-the-Splunk-REST-API-to-update-macros-that-live-under/m-p/684669#M114224</guid>
      <dc:creator>starbuck</dc:creator>
      <dc:date>2024-04-18T15:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do use the Splunk REST API to update macros that live under a different app?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-use-the-Splunk-REST-API-to-update-macros-that-live-under/m-p/684675#M114227</link>
      <description>&lt;P&gt;Check some of the app permissions settings using the below, this may help troubleshoot - it sounds like a permissions issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rest splunk_server=local servicesNS/nobody/search/configs/conf-macros
| search eai:acl.app=my_new_app&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Apr 2024 15:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-use-the-Splunk-REST-API-to-update-macros-that-live-under/m-p/684675#M114227</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-04-18T15:58:44Z</dc:date>
    </item>
  </channel>
</rss>

