# How to use the value from kubernetes metadata in S3 output

**URL:** <https://discuss.elastic.co/t/how-to-use-the-value-from-kubernetes-metadata-in-s3-output/302975>\
**Category:** Logstash\
**Created:** [April 22, 2022, 3:43am UTC](https://discuss.elastic.co/t/how-to-use-the-value-from-kubernetes-metadata-in-s3-output/302975 "2022-04-22T03:43:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user2416](https://avatars.discourse-cdn.com/v4/letter/u/97f17d/32.png) [@user2416](https://discuss.elastic.co/u/user2416)\
**Post date:** [April 22, 2022, 3:43am UTC](https://discuss.elastic.co/t/how-to-use-the-value-from-kubernetes-metadata-in-s3-output/302975/1 "2022-04-22T03:43:26Z")

</div>

Hi,

I am trying to use the service name which will get from kubernetes metadata to use in S3 output to construct prefix, how can I use that field value in output?

---

<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 22, 2022, 4:38pm UTC](https://discuss.elastic.co/t/how-to-use-the-value-from-kubernetes-metadata-in-s3-output/302975/2 "2022-04-22T16:38:22Z")

</div>

Use a [sprintf](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#sprintf) reference.

---

<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 20, 2022, 4:39pm UTC](https://discuss.elastic.co/t/how-to-use-the-value-from-kubernetes-metadata-in-s3-output/302975/3 "2022-05-20T16:39:05Z")

</div>

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