# Logstash output s3 prefix with date

**URL:** <https://discuss.elastic.co/t/logstash-output-s3-prefix-with-date/336498>\
**Category:** Logstash\
**Created:** [June 20, 2023, 3:00pm UTC](https://discuss.elastic.co/t/logstash-output-s3-prefix-with-date/336498 "2023-06-20T15:00:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kunalmohan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kunalmohan/32/122508_2.png) [@kunalmohan](https://discuss.elastic.co/u/kunalmohan)\
**Post date:** [June 20, 2023, 3:00pm UTC](https://discuss.elastic.co/t/logstash-output-s3-prefix-with-date/336498/1 "2023-06-20T15:00:56Z")

</div>

[S3 output plugin | Logstash Reference [8.8] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-s3.html#plugins-outputs-s3-prefix) mentions to use `prefix = "%{+YYYY}/%{+MM}/%{+dd}"` for creating folders based on event date. This doesn't work for my. It simply creates two nested folders with name `/`. So my file is saved in `//<file-name>.txt` inside the bucket. How do I fix this?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 20, 2023, 3:10pm UTC](https://discuss.elastic.co/t/logstash-output-s3-prefix-with-date/336498/2 "2023-06-20T15:10:27Z")

</div>

> [@kunalmohan](#):
>
> This doesn't work for my.

Please share your Logstash configuration.

---

<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 18, 2023, 3:11pm UTC](https://discuss.elastic.co/t/logstash-output-s3-prefix-with-date/336498/3 "2023-07-18T15:11:00Z")

</div>

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