<?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 How to enable and disable scheduled searches using Splunk REST API in Powershell? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-enable-and-disable-scheduled-searches-using-Splunk-REST/m-p/206913#M40856</link>
    <description>&lt;P&gt;I have a requirement to disable scheduled search (specific ones) during a specific window and when a data load runs, enable it back on once the load is completed. &lt;BR /&gt;
I have a limitation of running it Powershell. I went through couple of Answers posts and was not able to find a post related to Powershell implementation.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 22:25:30 GMT</pubDate>
    <dc:creator>vivekriyer</dc:creator>
    <dc:date>2016-09-22T22:25:30Z</dc:date>
    <item>
      <title>How to enable and disable scheduled searches using Splunk REST API in Powershell?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-enable-and-disable-scheduled-searches-using-Splunk-REST/m-p/206913#M40856</link>
      <description>&lt;P&gt;I have a requirement to disable scheduled search (specific ones) during a specific window and when a data load runs, enable it back on once the load is completed. &lt;BR /&gt;
I have a limitation of running it Powershell. I went through couple of Answers posts and was not able to find a post related to Powershell implementation.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 22:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-enable-and-disable-scheduled-searches-using-Splunk-REST/m-p/206913#M40856</guid>
      <dc:creator>vivekriyer</dc:creator>
      <dc:date>2016-09-22T22:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable and disable scheduled searches using Splunk REST API in Powershell?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-enable-and-disable-scheduled-searches-using-Splunk-REST/m-p/206914#M40857</link>
      <description>&lt;P&gt;I am not a powershell user... however it looks like there's a cmdlet to Invoke a HTTP Rest service, namely Invoke-RestMethod: &lt;A href="https://technet.microsoft.com/en-us/library/hh849971.aspx"&gt;https://technet.microsoft.com/en-us/library/hh849971.aspx&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In fact the documentation on that page has an example of performing a POST request that's using the Splunk API to execute a Splunk search and getting results from it. &lt;/P&gt;

&lt;P&gt;Armed with this, and the Splunk REST reference, it should be only minor modifications to the $Url and $Body arguments to then be able to modify your saved search (to schedule / unschedule it at whim): &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.3/RESTREF/RESTsearch#POST_saved.2Fsearches.2F.7Bname.7D_method_detail"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.3/RESTREF/RESTsearch#POST_saved.2Fsearches.2F.7Bname.7D_method_detail&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 23:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-enable-and-disable-scheduled-searches-using-Splunk-REST/m-p/206914#M40857</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2016-09-22T23:19:47Z</dc:date>
    </item>
  </channel>
</rss>

