# Customize \`value\_serializerer \` for the

**URL:** <https://discuss.elastic.co/t/customize-value-serializerer-for-the/364095>\
**Category:** Logstash\
**Created:** [July 30, 2024, 11:35pm UTC](https://discuss.elastic.co/t/customize-value-serializerer-for-the/364095 "2024-07-30T23:35:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)\
**Post date:** [July 30, 2024, 11:35pm UTC](https://discuss.elastic.co/t/customize-value-serializerer-for-the/364095/1 "2024-07-30T23:35:50Z")

</div>

Hi all,

I am currently trying to leverage the [Kafka output plugin](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-kafka.html#plugins-outputs-kafka-value_serializer) and one of the options it exposes is the `value_serializerer` field

Sadly, the docs do not specify how to customize this value with a custom JAR (ie: `com.myrg.mySerializer`)

Do you know if this is possible?

---

<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:** [July 31, 2024, 12:14am UTC](https://discuss.elastic.co/t/customize-value-serializerer-for-the/364095/2 "2024-07-31T00:14:29Z")

</div>

> [@yeikel](#):
>
> Do you know if this is possible?

It is not. The [output](https://github.com/logstash-plugins/logstash-output-kafka/blob/e570b80b7de536a03662f9453d49cedf9f62ea56/lib/logstash/outputs/kafka.rb#L191) validates value\_serializer and if it doesn't like the value it logs

> 'value\_serializer' only supports org.apache.kafka.common.serialization.ByteArraySerializer and org.apache.kafka.common.serialization.StringSerializer

---

<div class="post-metadata">

**Author:** ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)\
**Post date:** [July 31, 2024, 12:37am UTC](https://discuss.elastic.co/t/customize-value-serializerer-for-the/364095/3 "2024-07-31T00:37:53Z")

</div>

Thanks for pointing this out

I was trying to apply a data transformation before the data is inserted into Kafka while leaving the original data unaltered for other output plugins (I have multiple entries)

Typically, that's where custom a `value_serializerer` would come into the picture

Is there any native/recommended method to do this in Logstash?

---

<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:** [July 31, 2024, 12:55am UTC](https://discuss.elastic.co/t/customize-value-serializerer-for-the/364095/4 "2024-07-31T00:55:36Z")

</div>

You might be able to use pipeline-to-pipeline communication with a [forked-path pattern](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html#forked-path-pattern) if want to do some processing just for one output.
