# S3 Output Plugin tag in Filename

**URL:** <https://discuss.elastic.co/t/s3-output-plugin-tag-in-filename/261087>\
**Category:** Logstash\
**Created:** [January 14, 2021, 7:28am UTC](https://discuss.elastic.co/t/s3-output-plugin-tag-in-filename/261087 "2021-01-14T07:28:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![okgnae](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/okgnae/32/82212_2.png) [@okgnae](https://discuss.elastic.co/u/okgnae)\
**Post date:** [January 14, 2021, 7:28am UTC](https://discuss.elastic.co/t/s3-output-plugin-tag-in-filename/261087/1 "2021-01-14T07:28:58Z")

</div>

> **[S3 output plugin | Logstash Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-s3.html#_s3_output_file)**

The filenames uploaded to S3 are auto generated by logstash, but there seems to be a way to add a "tag" to the file name. What is the proper syntaxt to preform this function?

The docs mention this as a possibility, but don't define how it should be accomplished.

I have a tag set up on my input plugin.

`tags => ["hello_world"]`

I was expecting to see the filenames uploaded to s3 to be something like:  
`ls.s3.312bc026-2f5d-49bc-ae9f-5940cf4ad9a6.2013-04-18T10.00.hello_world.part0.txt`

but getting:  
`ls.s3.312bc026-2f5d-49bc-ae9f-5940cf4ad9a6.2013-04-18T10.00.part0.txt`

I looked at the rubydbug output of my events and see the tag hello\_world being applied to my events.

```auto
 "tags" => [
        [0] "hello_world"
    ]

```

---

<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:** [January 14, 2021, 3:31pm UTC](https://discuss.elastic.co/t/s3-output-plugin-tag-in-filename/261087/2 "2021-01-14T15:31:18Z")

</div>

> [@okgnae](#):
>
> I have a tag set up on my input plugin

If you add a "tags" option to an input (or filter) plugin then it adds a [tags] field which is an array of strings. If you add a "tags" option to an s3 output plugin then it appends the tags to the file name.

The tags option needs to be on the output, not the input.

---

<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:** [February 11, 2021, 3:31pm UTC](https://discuss.elastic.co/t/s3-output-plugin-tag-in-filename/261087/3 "2021-02-11T15:31:19Z")

</div>

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