Getting Data In

Problem with deleting event data on specific time

C_Sparn
Communicator

Hello,

I'm looking for a possibility to delete all eventdata of one index at a specific time on every day! It is not important to use the "splunk clean eventdata -index" command. It can also be just an "search index = any |delete".
Whats the best method to get this working?
Greetings

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Why would you want to do that? If you're trying to limit searches to today you can do that by adding 'earliest=-1d' to your queries.

If you really want to delete data every day you either set up a cron job to run 'splunk clean eventdata' at the desired time or create a Splunk scheduled search for 'index=foo | delete'.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Why would you want to do that? If you're trying to limit searches to today you can do that by adding 'earliest=-1d' to your queries.

If you really want to delete data every day you either set up a cron job to run 'splunk clean eventdata' at the desired time or create a Splunk scheduled search for 'index=foo | delete'.

---
If this reply helps you, Karma would be appreciated.

C_Sparn
Communicator

Hello,
Yes I really need to delete every day.
Thanks the scheduled search is good idea and it should work for this situation. The cron job is difficult because you need to stop splunk for clean eventdata.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...