Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 input does not delete files #45

Open
keeshoekzema opened this issue May 23, 2024 · 0 comments
Open

S3 input does not delete files #45

keeshoekzema opened this issue May 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@keeshoekzema
Copy link

keeshoekzema commented May 23, 2024

I am aware that I am using an S3-compatible solution and this is not supported. However, this is an easy fix.

Logstash information:

Please include the following information:

  1. Logstash version: 8.13.4
  2. Logstash installation source: docker.elastic.co/logstash/logstash:8.13.4

Description of the problem including expected versus actual behavior:

When running the S3 input-plugin, files are not deleted or backed up when using Ceph-RGW as S3 storage

Steps to reproduce:

input {
  s3 {
    access_key_id => "${ACCESS_KEY_ID}"
    secret_access_key => "${SECRET_ACCESS_KEY}"
    bucket => "test"
    additional_settings => {
      force_path_style => true
      follow_redirects => false
    }
    endpoint => "http://ceph-rgw"
    delete => true
  }
}

Provide logs (if relevant):

This gives the following output:

[2024-05-23T14:52:01,565][INFO ][logstash.inputs.s3       ][main][..] object-in-bucket-xyz is updated at 2024-05-23 13:58:33 UTC and will process in the next cycle

Which means the file is not deleted. In the next cycle, the timestamps still don't match so it again is not deleted.

When changing the log output to include both timestamps here the issue becomes clear:

object.last_modified: 2024-05-23 13:33:33.000000000 Z
log.last_modified: 2024-05-23 13:33:33.898000000 Z

An easy fix would be to change line 380 to:

if object.last_modified.floor == log.last_modified.floor

I have not tested this against S3, but i assume they give the timestamp in miliseconds while ceph-rgw does not. I totally understand it if you don't want to fix it, in that case i'll just leave this information here as a workaround for anyone having the same problem.

@keeshoekzema keeshoekzema added the bug Something isn't working label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant