# Logstash s3 input reads file multiple times

**URL:** https://discuss.elastic.co/t/logstash-s3-input-reads-file-multiple-times/336751
**Category:** Logstash
**Created:** [June 23, 2023, 8:52am UTC](https://discuss.elastic.co/t/logstash-s3-input-reads-file-multiple-times/336751 "2023-06-23T08:52:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jpchev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpchev/32/47826_2.png) [@jpchev](https://discuss.elastic.co/u/jpchev)
#### Post date: [June 23, 2023, 8:52am UTC](https://discuss.elastic.co/t/logstash-s3-input-reads-file-multiple-times/336751/1 "2023-06-23T08:52:56Z")

</div>

hello,  
I have configured the following s3 input in logstash, and it keeps reading the same file from the given S3 bucket. I noticed that the given sincedb file ${DATA\_DIR}/.sincedb\_activities.txt is being used and it contains the date and time corresponding to the last modified value of the file on S3.

What am I missing? Do I need to set the parameter delete to true ? As far as I understand, that should not be necessary, as the sincedb mechanism should guarantee files are processed only once. Thanks

```auto
#############
# INPUT #
#############
input {

  s3 {
    access_key_id => "${AWS_ACCESS_KEY_ID}"
    secret_access_key => "${AWS_SECRET_ACCESS_KEY}"
    endpoint => "${S3_ENDPOINT}"
    bucket => "${INPUT_BUCKET}"
    temporary_directory => "/tmp/logstash"
    prefix => "activities"
    additional_settings => {
      force_path_style => true
      follow_redirects => false
    }
    codec => multiline {
      charset => "UTF-8"
      auto_flush_interval => 5
      pattern => '^([0-9]+|id_activ),'
      negate => true
      what => "previous"
    }
    sincedb_path => "${DATA_DIR}/.sincedb_activities.txt"
    add_field => {
      "type_fichier" => "db_activity"
      "[@metadata][index]" => "${ACT_IDX}"
      "[@metadata][pipeline]" => "ACT"
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 21, 2023, 8:53am UTC](https://discuss.elastic.co/t/logstash-s3-input-reads-file-multiple-times/336751/2 "2023-07-21T08:53:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
