# Tell Logstash to ignore old files in s3 bucket

**URL:** <https://discuss.elastic.co/t/tell-logstash-to-ignore-old-files-in-s3-bucket/226759>\
**Category:** Logstash\
**Created:** [April 6, 2020, 6:01pm UTC](https://discuss.elastic.co/t/tell-logstash-to-ignore-old-files-in-s3-bucket/226759 "2020-04-06T18:01:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clarkritchie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clarkritchie/32/65755_2.png) [@clarkritchie](https://discuss.elastic.co/u/clarkritchie)\
**Post date:** [April 6, 2020, 6:01pm UTC](https://discuss.elastic.co/t/tell-logstash-to-ignore-old-files-in-s3-bucket/226759/1 "2020-04-06T18:01:13Z")

</div>

I'm using the Logstash s3 plugin to ingest logs from a partner's S3 bucket.

Logstash itself runs in a container, so its sincedb is not persistent. When the container re-starts, Logstash restarts and begins ingesting logs from that bucket since the beginning of time.

`delete` or `backup_to_bucket` is not really an option because it's not my bucket to manage.

Is there a way I can tell Logstash to ignore anything older than ~1 day?

Can I seed sincedb with a date? e.g. before Logstash starts, can I echo a date in the format `2020-01-31 07:01:33 +0000` (where that date is ~one day ago) to:

`/var/lib/logstash/plugins/inputs/s3`

What is the syntax for the hash on the name of the sincedb file? e.g. `sincedb_ca090558edfcc5759ac626c813a5a2c2`. Or I can just make this whatever I want and use `sincedb_path`.

Any other suggestions? Thanks in advance. -Clark

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 6, 2020, 7:04pm UTC](https://discuss.elastic.co/t/tell-logstash-to-ignore-old-files-in-s3-bucket/226759/2 "2020-04-06T19:04:54Z")

</div>

[This](https://discuss.elastic.co/t/skip-reading-historical-data-in-logstash-while-parsing-logs/129221) thread is about dropping events using the output of an age{} filter. It would still read the bucket, but not reprocess all the data.

---

<div class="post-metadata">

**Author:** ![clarkritchie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clarkritchie/32/65755_2.png) [@clarkritchie](https://discuss.elastic.co/u/clarkritchie)\
**Post date:** [April 6, 2020, 7:47pm UTC](https://discuss.elastic.co/t/tell-logstash-to-ignore-old-files-in-s3-bucket/226759/3 "2020-04-06T19:47:25Z")

</div>

That's great, thank you! I have also since implemented that `sincedb` workaround and believe startup times are much better now. Appreciate the follow up!

---

<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:** [May 4, 2020, 7:47pm UTC](https://discuss.elastic.co/t/tell-logstash-to-ignore-old-files-in-s3-bucket/226759/4 "2020-05-04T19:47:32Z")

</div>

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