Skip to main content
Solved

Is It Possible Somehow To Delete Data In An S3 Bucket Within Cribl

  • May 15, 2026
  • 2 replies
  • 2 views

This message originated from Cribl Community Slack.
Click here to view the original link.

Good morning everyone, I have maybe a crazy question. Is it possible somehow to delete data in an S3 bucket within Cribl? Like some REST POST on the S3 delete endpoint that runs everyday on the workers and deletes data in the bucket older than 30 days? For some reason, S3 lifecycles are not possible in this situation (don't ask me why..) and it seems the only option is to phase out the data over the API somehow. Thanks for any insight

Best answer by dbizon539

That would be a better use case to create a bash / powershell / python script to do than use Cribl to do something like that. I also found this while searching the internet: https://stackoverflow.com/questions/50467698/how-can-i-delete-files-older-than-seven-days-in-amazon-s3

2 replies

  • Employee
  • Answer
  • May 15, 2026
That would be a better use case to create a bash / powershell / python script to do than use Cribl to do something like that. I also found this while searching the internet: https://stackoverflow.com/questions/50467698/how-can-i-delete-files-older-than-seven-days-in-amazon-s3

  • New Participant
  • May 15, 2026
I think the best way to do that is with a Lifecycle Rule on the s3 bucket can be done via aws CLI:
aws s3api put-bucket-lifecycle-configuration \
  --bucket $$YOUR_BUCKET_NAME$$ \
  --lifecycle-configuration '{
    "Rules": [
      {
        "ID": "Delete objects older than 30 days",
        "Status": "Enabled",
        "Filter": {},
        "Expiration": {
          "Days": 30
        }
      }
    ]
  }'
Or in the console with S3 Console -> Management Tab -> Create Lifecycle Rule