<?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 set up a curl script to enable a scheduled search when an alert is triggered? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263144#M4874</link>
    <description>&lt;P&gt;Thank you...your colleagues come back with anything yet?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Apr 2016 15:50:04 GMT</pubDate>
    <dc:creator>sidekix24</dc:creator>
    <dc:date>2016-04-01T15:50:04Z</dc:date>
    <item>
      <title>How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263138#M4868</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm trying to set up a curl script to enable/disable a search under "Searches, reports, and alerts" when an alert is triggered.  I've done some searching on the boards and found the example below, but it's not working for me.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -ku admin:changeme &lt;A href="https://localhost:8089/servicesNS///saved/searches/" target="test_blank"&gt;https://localhost:8089/servicesNS///saved/searches/&lt;/A&gt; -d "is_scheduled=0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, a curl or CLI command that will drop a check mark in the box in the screen shot for me so I can script that out would solve my issue.&lt;/P&gt;

&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i.imgur.com/Kqr6WSm.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 21:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263138#M4868</guid>
      <dc:creator>sidekix24</dc:creator>
      <dc:date>2016-03-28T21:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263139#M4869</link>
      <description>&lt;P&gt;Hi @sidekix24,&lt;BR /&gt;
Here is some documentation on the script alert action:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Runscriptaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Runscriptaction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As of software version 6.3, the script alert action is deprecated, just FYI. You might want to consider a custom alert action as an alternative:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/AdvancedDev/ModAlertsIntro"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/AdvancedDev/ModAlertsIntro&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This documentation on the saved/searches/{name} endpoint might also help with updating the search scheduling as part of the alert action:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 22:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263139#M4869</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-28T22:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263140#M4870</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Is there something that needs to be enabled to run these commands?&lt;/P&gt;

&lt;P&gt;In the output, I get the message below.  The output doesn't match what I expect to see compared to the output in documents.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;P&gt;Splunk relies on JavaScript to function properly.&lt;BR /&gt;Please enable JavaScript and then refresh the page to login.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 18:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263140#M4870</guid>
      <dc:creator>sidekix24</dc:creator>
      <dc:date>2016-03-30T18:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263141#M4871</link>
      <description>&lt;P&gt;ok...I'm getting a little further but need some assistance if someone can help.&lt;/P&gt;

&lt;P&gt;I'm running the command below:&lt;/P&gt;

&lt;P&gt;-k -u admin:pass -XPOST &lt;A href="https://splunk.server/en-US/account/login?return_to=%2Fen-US%2Fmanager%2Flauncher%2Fsaved%2Fsearches%2FEnable%2520Test%2520status"&gt;https://splunk.server/en-US/account/login?return_to=%2Fen-US%2Fmanager%2Flauncher%2Fsaved%2Fsearches%2FEnable%2520Test%2520status&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And  I'm getting this in return:&lt;/P&gt;

&lt;P&gt;{"status":1}&lt;/P&gt;

&lt;P&gt;I've tried enabling and disabling the status of the saved search in "Searches, reports, and alerts" but that status doesn't change every time I run that command, it stays at {"status":1}.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 19:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263141#M4871</guid>
      <dc:creator>sidekix24</dc:creator>
      <dc:date>2016-03-30T19:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263142#M4872</link>
      <description>&lt;P&gt;Even a command to enable/disable the saved search would solve my issue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 20:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263142#M4872</guid>
      <dc:creator>sidekix24</dc:creator>
      <dc:date>2016-03-30T20:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263143#M4873</link>
      <description>&lt;P&gt;Hi @sidekix24,&lt;BR /&gt;
Thanks for the follow-up. Sounds like something is not quite right. I'm going to run your questions by some of my colleagues. I'll report back ASAP!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 22:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263143#M4873</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-30T22:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263144#M4874</link>
      <description>&lt;P&gt;Thank you...your colleagues come back with anything yet?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 15:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263144#M4874</guid>
      <dc:creator>sidekix24</dc:creator>
      <dc:date>2016-04-01T15:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263145#M4875</link>
      <description>&lt;P&gt;Thanks for hanging in there. Can you confirm that the URL you posted above is the one you're using?  I'm curious about what happens if/when you use the saved/searches/{name_of_your_search} endpoint that I mentioned above in the REST documentation...&lt;/P&gt;

&lt;P&gt;Importantly, be sure to specify the name of the saved search that you want to schedule as part of the URL you are using here. &lt;/P&gt;

&lt;P&gt;For example, one of my colleagues posted this example:&lt;/P&gt;

&lt;P&gt;curl -ku admin:changeme &lt;A href="https://localhost:8089/servicesNS///saved/searches/" target="_blank"&gt;https://localhost:8089/servicesNS///saved/searches/&lt;/A&gt; -d "is_scheduled=0"&lt;/P&gt;

&lt;P&gt;eg &lt;/P&gt;

&lt;P&gt;curl -ku admin:changeme &lt;A href="https://localhost:8089/servicesNS/admin/seach/saved/searches/foobar" target="_blank"&gt;https://localhost:8089/servicesNS/admin/seach/saved/searches/foobar&lt;/A&gt; -d "is_scheduled=0"&lt;/P&gt;

&lt;P&gt;in this older Answers post that I think might help:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/174869/how-to-disable-scheduled-searches-via-command-line.html" target="_blank"&gt;https://answers.splunk.com/answers/174869/how-to-disable-scheduled-searches-via-command-line.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263145#M4875</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2020-09-29T09:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up a curl script to enable a scheduled search when an alert is triggered?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263146#M4876</link>
      <description>&lt;P&gt;frobinson,&lt;/P&gt;

&lt;P&gt;I got it working.  My endpoints were incorrect for the saved searches.  Once I fixed those, the whole process came together and worked.  I was able to successfully build a script to trigger a second search then another script to disable that search once it sends out the "all clear" message.&lt;/P&gt;

&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-a-curl-script-to-enable-a-scheduled-search-when-an/m-p/263146#M4876</guid>
      <dc:creator>sidekix24</dc:creator>
      <dc:date>2016-04-06T16:21:54Z</dc:date>
    </item>
  </channel>
</rss>

