As per the REST API Reference Manual, it is possible to stop searches using the 'finalize' action.
In an environment with multiple searches running more than 24 hours, the REST API is used to stop these searches that do not produce results in such a long time. The command used is this:
curl method=post uri=https://localhost:8801/services/search/jobs/$sid$/control splunkauth=true data=\"action=finalize\"
However, this command succeeds with most of the searches but fails to stop the searches that are in the parsing state. Those ones need to be stopped killing the OS process.
curl method=post uri=https://localhost:8801/services/search/jobs/$sid$/control splunkauth=true data=\"action=cancel\"
Splunk Documentation
REST API Reference Manual
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
28-Sep-2026
|
Initial Release |