<?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 to enable/disable a saved search using Python SDK? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288943#M3594</link>
    <description>&lt;P&gt;Any luck??&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jan 2018 05:12:50 GMT</pubDate>
    <dc:creator>bollam</dc:creator>
    <dc:date>2018-01-22T05:12:50Z</dc:date>
    <item>
      <title>How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288933#M3584</link>
      <description>&lt;P&gt;Can someone assist me in how to enable and disable the saved searches using python SDK?&lt;BR /&gt;
I have gone through the docs of python SDK and got how to create and delete but where in I was looking for enabling and disabling the saved searches. Prompt response would be highly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 08:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288933#M3584</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-01-05T08:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288934#M3585</link>
      <description>&lt;P&gt;Hi @bollam,&lt;/P&gt;

&lt;P&gt;Can you please try below python code for disabling saved search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.rest as rest
rest.simpleRequest('/servicesNS/&amp;lt;USER&amp;gt;/&amp;lt;APPNAME&amp;gt;/saved/searches/&amp;lt;YOURSEARCH&amp;gt;', sessionKey=sessionKey, postargs={'disabled': 1}, method='POST', raiseAllErrors=True)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And to enable it again&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.rest as rest
rest.simpleRequest('/servicesNS/&amp;lt;USER&amp;gt;/&amp;lt;APPNAME&amp;gt;/saved/searches/&amp;lt;YOURSEARCH&amp;gt;', sessionKey=sessionKey, postargs={'disabled': 0}, method='POST', raiseAllErrors=True)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2018 12:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288934#M3585</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-01-05T12:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288935#M3586</link>
      <description>&lt;P&gt;do you mean turning on or off a schedule?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 12:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288935#M3586</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-01-05T12:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288936#M3587</link>
      <description>&lt;P&gt;Hi @harsmarvania57 ,&lt;BR /&gt;
I have written code snippet for a basic query validation. Upon successful validation, It should either create, delete, enable or disable the saved search I provide. It was working for creating and deleting the saved search but I'm finding hard to enable or disable the saved search using python SDK. Is there a way to disable or enable the saved search using python SDK? &lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 03:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288936#M3587</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-01-08T03:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288937#M3588</link>
      <description>&lt;P&gt;Yes, Exactly&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 03:42:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288937#M3588</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-01-08T03:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288938#M3589</link>
      <description>&lt;P&gt;What's your code snippet ? Have you tried code which I have given in my first comment ?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 09:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288938#M3589</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-01-08T09:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288939#M3590</link>
      <description>&lt;P&gt;Please try below..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunklib.client as client

HOST = "localhost"
PORT = 8089
USERNAME = "admin"
PASSWORD = "changeme"

service = client.connect(
    host=HOST,
    port=PORT,
    username=USERNAME,
    password=PASSWORD)

for ss in service.saved_searches:
    print ss.name
    ss.disable()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2018 12:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288939#M3590</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2018-01-08T12:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288940#M3591</link>
      <description>&lt;P&gt;@ paramagurukarthikeyan, Thanks much!! Its working as expected.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 04:41:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288940#M3591</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-01-09T04:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288941#M3592</link>
      <description>&lt;P&gt;Always Welcome&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 07:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288941#M3592</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2018-01-16T07:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288942#M3593</link>
      <description>&lt;P&gt;Hi @paramagurukarthikeyan, How do we enable/disable the saved search which contains the special character in it? I'm getting error while trying enable/disable saved search. Saved search I'm trying to disable is "Testing@#splunk". I'm able to create the saved search with this name but disable is not working. Can you help on this as well?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 07:41:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288942#M3593</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-01-18T07:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable/disable a saved search using Python SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288943#M3594</link>
      <description>&lt;P&gt;Any luck??&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 05:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-enable-disable-a-saved-search-using-Python-SDK/m-p/288943#M3594</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-01-22T05:12:50Z</dc:date>
    </item>
  </channel>
</rss>

