Splunk Search

Can we automatically delete searches?

ddrillic
Ultra Champion

A Splunk user told us that after every search they run, they go and delete it, and by doing that, they avoid the quota problems. Not the nicest procedure but it seems to be practical. Is there a way to do it automatically for users who choose to?

Tags (2)
0 Karma

tiagofbmm
Influencer

The timetolive TTL of a job can vary with many things, such as if it is a ad-hoc search, a scheduled search (varies with the frequency it runs), or the alert actions that may come out of the scheduled report, or even if the user is actively viewing a dashboard, or even if it shares the job or saves it!

So as you can see there are many reasons for a job not to be deleted. If you really want to do such thing, you need to point at the endpoint:

curl -k -u admin:pass --request DELETE https://localhost:8089/services/search/jobs/scheduler__nobody_c3BsdW5rX2FyY2hpdmVy__RMD5473cbac83d6c...

0 Karma

tiagofbmm
Influencer

@ddrillic please accept an answer if it solved/helped it and upvote it. Otherwise let us know how can we help further

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...