<?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: Is there a search or REST command to stop running searches forcefully? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121653#M32756</link>
    <description>&lt;P&gt;Hi splunk_worker,&lt;/P&gt;

&lt;P&gt;Yes, there is a REST command to stop a running search.&lt;/P&gt;

&lt;P&gt;Use this command to get a list of searches back:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:&amp;lt;pwd&amp;gt; &lt;A href="https://localhost:8089/services/search/jobs/" target="test_blank"&gt;https://localhost:8089/services/search/jobs/&lt;/A&gt; | grep '&amp;lt;id&amp;gt;'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use the `` URL to cancel/delete this search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:&amp;lt;pwd&amp;gt; --request DELETE &lt;A href="https://localhost:8089/services/search/jobs/1416293763.77" target="test_blank"&gt;https://localhost:8089/services/search/jobs/1416293763.77&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and get back a response like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="INFO"&amp;gt;Search job cancelled.&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more details have a look at the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/RESTREF/RESTsearchExamples#search.2Fjobs.2F.7Bsearch_id.7D_DELETE"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/RESTREF/RESTsearchExamples#search.2Fjobs.2F.7Bsearch_id.7D_DELETE&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you just need a nice table view of the running jobs, you can do this as well from the Splunk UI using this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/search/jobs/ | table author, id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Tue, 18 Nov 2014 07:35:57 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-11-18T07:35:57Z</dc:date>
    <item>
      <title>Is there a search or REST command to stop running searches forcefully?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121652#M32755</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I want identify the long running searches who are running more than 5 min and stop them. &lt;/P&gt;

&lt;P&gt;I'm able to find the long running searches from this command index=_internal source=&lt;EM&gt;scheduler.log&lt;/EM&gt;  run_time=* | table savedsearch_name, user, app, run_time, _time | sort - run_time&lt;/P&gt;

&lt;P&gt;But, I'm not able to find what is the way to stop them? &lt;BR /&gt;
Q1. Is there search command I can use to stop the running searches?&lt;BR /&gt;
Q2. Do I need to pass this result to script and call REST command to Splunkd to stop the running searches? If yes, what is the REST command to stop the searches?&lt;/P&gt;

&lt;P&gt;Please do the needful.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:10:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121652#M32755</guid>
      <dc:creator>splunk_worker</dc:creator>
      <dc:date>2020-09-28T18:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a search or REST command to stop running searches forcefully?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121653#M32756</link>
      <description>&lt;P&gt;Hi splunk_worker,&lt;/P&gt;

&lt;P&gt;Yes, there is a REST command to stop a running search.&lt;/P&gt;

&lt;P&gt;Use this command to get a list of searches back:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:&amp;lt;pwd&amp;gt; &lt;A href="https://localhost:8089/services/search/jobs/" target="test_blank"&gt;https://localhost:8089/services/search/jobs/&lt;/A&gt; | grep '&amp;lt;id&amp;gt;'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use the `` URL to cancel/delete this search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u admin:&amp;lt;pwd&amp;gt; --request DELETE &lt;A href="https://localhost:8089/services/search/jobs/1416293763.77" target="test_blank"&gt;https://localhost:8089/services/search/jobs/1416293763.77&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and get back a response like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="INFO"&amp;gt;Search job cancelled.&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more details have a look at the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/RESTREF/RESTsearchExamples#search.2Fjobs.2F.7Bsearch_id.7D_DELETE"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/RESTREF/RESTsearchExamples#search.2Fjobs.2F.7Bsearch_id.7D_DELETE&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you just need a nice table view of the running jobs, you can do this as well from the Splunk UI using this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/search/jobs/ | table author, id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2014 07:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121653#M32756</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-11-18T07:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a search or REST command to stop running searches forcefully?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121654#M32757</link>
      <description>&lt;P&gt;Hi @MuS,&lt;/P&gt;

&lt;P&gt;Whats the Windows equivalent of the above curl command ?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 00:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121654#M32757</guid>
      <dc:creator>damode</dc:creator>
      <dc:date>2017-10-24T00:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a search or REST command to stop running searches forcefully?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121655#M32758</link>
      <description>&lt;P&gt;Hi damode,&lt;/P&gt;

&lt;P&gt;there is actually a windows version of &lt;CODE&gt;curl&lt;/CODE&gt; available here &lt;A href="https://curl.haxx.se/download.html"&gt;https://curl.haxx.se/download.html&lt;/A&gt; or try this one &lt;A href="https://superuser.com/questions/344927/powershell-equivalent-of-curl"&gt;https://superuser.com/questions/344927/powershell-equivalent-of-curl&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Not a windows user so cannot be of much help here &lt;CODE&gt;¯\_(ツ)_/¯&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 01:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121655#M32758</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-10-24T01:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a search or REST command to stop running searches forcefully?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121656#M32759</link>
      <description>&lt;P&gt;Hi MuS,&lt;/P&gt;

&lt;P&gt;Thanks for sharing the links. &lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 02:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-search-or-REST-command-to-stop-running-searches/m-p/121656#M32759</guid>
      <dc:creator>damode</dc:creator>
      <dc:date>2017-10-24T02:57:08Z</dc:date>
    </item>
  </channel>
</rss>

