<?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: Where can I find documentation on how to update a macro by using the API? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387333#M69477</link>
    <description>&lt;P&gt;I do know where the Splunk documentation is and have already made extensive use of it to get to this point.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 13:12:56 GMT</pubDate>
    <dc:creator>whiterd434</dc:creator>
    <dc:date>2018-09-21T13:12:56Z</dc:date>
    <item>
      <title>Where can I find documentation on how to update a macro by using the API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387330#M69474</link>
      <description>&lt;P&gt;I have successfully used the code below to create a macro (POST using 'requests' with Python). However, I have been unable to find any documentation that states this being possible.  Based on the error messages I came across, "definition" is known as a "handler" within the Splunk API. I am trying to find any other "handlers" that I can target for updating macros.  The main thing I would like to accomplish now is to change the permission level of a newly created macro to the app it is inside of (since it defaults to owner only).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;payload = {'definition': 'query here'}
URL = 'root/servicesNS/username/app_name/admin/macros/macro_name'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you for your time.&lt;BR /&gt;
-Randall&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 20:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387330#M69474</guid>
      <dc:creator>whiterd434</dc:creator>
      <dc:date>2018-09-20T20:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find documentation on how to update a macro by using the API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387331#M69475</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;

&lt;P&gt;Would the below documentation be of use to you:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/restapi"&gt;http://dev.splunk.com/restapi&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.3/RESTTUT/RESTbasicexamples"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.3/RESTTUT/RESTbasicexamples&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 10:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387331#M69475</guid>
      <dc:creator>paulbannister</dc:creator>
      <dc:date>2018-09-21T10:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find documentation on how to update a macro by using the API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387332#M69476</link>
      <description>&lt;P&gt;Thank you for the response, but the links provided do not provide any information on creating/updating a macro through use of the API. I should have been more specific. I have already searched everything I can think of. The closest I have been able to come is the documentation for "saved searches", but I have been unable to figure out how to modify the app scope of a given macro.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 13:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387332#M69476</guid>
      <dc:creator>whiterd434</dc:creator>
      <dc:date>2018-09-21T13:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find documentation on how to update a macro by using the API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387333#M69477</link>
      <description>&lt;P&gt;I do know where the Splunk documentation is and have already made extensive use of it to get to this point.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 13:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387333#M69477</guid>
      <dc:creator>whiterd434</dc:creator>
      <dc:date>2018-09-21T13:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find documentation on how to update a macro by using the API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387334#M69478</link>
      <description>&lt;P&gt;I found part of my answer. While I still cannot find specific documentation on creating/updating macros through the API, I found how to update the scope after the fact.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;payload = {'owner': 'username', 'sharing': 'app'}
URL = 'root/servicesNS/username/app_name/admin/macros/macro_name/acl'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/RESTUM/RESTusing#Access_Control_List"&gt;Access Control List Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 14:15:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387334#M69478</guid>
      <dc:creator>whiterd434</dc:creator>
      <dc:date>2018-09-21T14:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find documentation on how to update a macro by using the API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387335#M69479</link>
      <description>&lt;P&gt;Typically you can use handlers to update conf files (such as the services/data/transforms endpoint for transforms.conf), but macros are an exception. The Splunk REST API does not offer any dedicated handlers for macros. &lt;/P&gt;

&lt;P&gt;You can use the /acl endpoint to change permissions (as you discovered), or you can use the /properties or /configs handlers to manipulate macros.conf files directly: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 20:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Where-can-I-find-documentation-on-how-to-update-a-macro-by-using/m-p/387335#M69479</guid>
      <dc:creator>stephaniem_splu</dc:creator>
      <dc:date>2018-10-23T20:29:01Z</dc:date>
    </item>
  </channel>
</rss>

