<?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: Python code please to modify alert permissions (owner, app and sharing) using splunklib SDK ? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/518597#M10840</link>
    <description>&lt;P&gt;import requests&lt;/P&gt;&lt;P&gt;data = {&lt;BR /&gt;'owner' : '&amp;lt;owner&amp;gt;',&lt;BR /&gt;'sharing' : '&amp;lt;app/global/system&amp;gt;',&lt;BR /&gt;'perms.read' : '*',&lt;BR /&gt;'perms.write' : 'admin,power'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;url = 'https://&amp;lt;hostname&amp;gt;:8089/services/apps/local/test_app/acl'&lt;BR /&gt;response = requests.post(url, data=data, verify=False, auth=('admin', '&amp;lt;password&amp;gt;'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2020 05:21:49 GMT</pubDate>
    <dc:creator>harimadambi</dc:creator>
    <dc:date>2020-09-09T05:21:49Z</dc:date>
    <item>
      <title>Python code please to modify alert permissions (owner, app and sharing) using splunklib SDK ?</title>
      <link>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334383#M10836</link>
      <description>&lt;P&gt;Created splunk search and alert using splunklib.client python module but not able to find a way to modify alert owner, app and sharing parameters.please help with sample python code.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 18:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334383#M10836</guid>
      <dc:creator>dhiren051</dc:creator>
      <dc:date>2018-04-12T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python code please to modify alert permissions (owner, app and sharing) using splunklib SDK ?</title>
      <link>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334384#M10837</link>
      <description>&lt;P&gt;See if this link helps:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/509056/how-do-you-change-the-owner-of-a-saved-search-usin-1.html"&gt;https://answers.splunk.com/answers/509056/how-do-you-change-the-owner-of-a-saved-search-usin-1.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 18:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334384#M10837</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-12T18:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python code please to modify alert permissions (owner, app and sharing) using splunklib SDK ?</title>
      <link>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334385#M10838</link>
      <description>&lt;P&gt;I tried that link but got error 404 - my last 3 updated lines are:&lt;/P&gt;

&lt;P&gt;url ="/servicesNS/nobody/system/{0}/acl".format(my_saved_search_name)&lt;/P&gt;

&lt;H1&gt;Note: since i created alert via splunklib , it got created with -- owner=nobody, app=system and sharing=global&lt;/H1&gt;

&lt;P&gt;params: {'sharing':'app'}&lt;BR /&gt;
sendrequest (params, server, url)&lt;/P&gt;

&lt;P&gt;Also, I tried  java code example from below link, but not sure how do i use kwargs here in python : &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/143030/sharing-an-object-to-an-app-and-modifying-its-permission-using-java-sdk.html" target="_blank"&gt;https://answers.splunk.com/answers/143030/sharing-an-object-to-an-app-and-modifying-its-permission-using-java-sdk.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;tried other several links from this blog - able to ran few of it in python but don't see any change in splunk UI. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334385#M10838</guid>
      <dc:creator>dhiren051</dc:creator>
      <dc:date>2020-09-29T18:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python code please to modify alert permissions (owner, app and sharing) using splunklib SDK ?</title>
      <link>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334386#M10839</link>
      <description>&lt;P&gt;Managed to play with search permissions with the following sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import urllib

url = 'http://admin:changeme@localhost:8089/servicesNS/nobody/poc/saved/searches/some_search/acl'
data = urllib.urlencode({'sharing': 'global', 'owner': 'admin'})

urllib.urlopen(url, data)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Apr 2018 10:22:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/334386#M10839</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-13T10:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python code please to modify alert permissions (owner, app and sharing) using splunklib SDK ?</title>
      <link>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/518597#M10840</link>
      <description>&lt;P&gt;import requests&lt;/P&gt;&lt;P&gt;data = {&lt;BR /&gt;'owner' : '&amp;lt;owner&amp;gt;',&lt;BR /&gt;'sharing' : '&amp;lt;app/global/system&amp;gt;',&lt;BR /&gt;'perms.read' : '*',&lt;BR /&gt;'perms.write' : 'admin,power'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;url = 'https://&amp;lt;hostname&amp;gt;:8089/services/apps/local/test_app/acl'&lt;BR /&gt;response = requests.post(url, data=data, verify=False, auth=('admin', '&amp;lt;password&amp;gt;'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 05:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-code-please-to-modify-alert-permissions-owner-app-and/m-p/518597#M10840</guid>
      <dc:creator>harimadambi</dc:creator>
      <dc:date>2020-09-09T05:21:49Z</dc:date>
    </item>
  </channel>
</rss>

