# Logstash S3 output prefix - Event field timestamp

**URL:** <https://discuss.elastic.co/t/logstash-s3-output-prefix-event-field-timestamp/314708>\
**Category:** Logstash\
**Created:** [September 19, 2022, 3:27pm UTC](https://discuss.elastic.co/t/logstash-s3-output-prefix-event-field-timestamp/314708 "2022-09-19T15:27:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tag\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tag_v/32/47466_2.png) [@tag\_v](https://discuss.elastic.co/u/tag_v)\
**Post date:** [September 19, 2022, 3:27pm UTC](https://discuss.elastic.co/t/logstash-s3-output-prefix-event-field-timestamp/314708/1 "2022-09-19T15:27:49Z")

</div>

How to set Logstash S3 output prefix dynamically with an event field value in format: "%{+YYYY}/%{+MM}/%{+dd}/%{+HH}" ?

```auto

input:
{"record_time":"2017-03-09T04:07:51.520Z"}

required s3 prefix: 
2017/03/09/04

```

---

<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:** [September 19, 2022, 7:05pm UTC](https://discuss.elastic.co/t/logstash-s3-output-prefix-event-field-timestamp/314708/2 "2022-09-19T19:05:32Z")

</div>

The output [sprintfs](https://github.com/logstash-plugins/logstash-output-s3/blob/4237da15e495520d11bae640d594493417739b16/lib/logstash/outputs/s3.rb#L247) the prefix, so you can use

```
prefix => "%{+YYYY}/%{+MM}/%{+dd}/%{+HH}"

```

---

<div class="post-metadata">

**Author:** ![tag\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tag_v/32/47466_2.png) [@tag\_v](https://discuss.elastic.co/u/tag_v)\
**Post date:** [September 20, 2022, 8:21am UTC](https://discuss.elastic.co/t/logstash-s3-output-prefix-event-field-timestamp/314708/3 "2022-09-20T08:21:48Z")

</div>

But this is taking @timestamp value I believe. But I want to use `record_time` field value from event.

---

<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:** [October 18, 2022, 8:22am UTC](https://discuss.elastic.co/t/logstash-s3-output-prefix-event-field-timestamp/314708/4 "2022-10-18T08:22:12Z")

</div>

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