# When using logstash to consume binary data, some bytes are replaced with ef bf bd

**URL:** https://discuss.elastic.co/t/when-using-logstash-to-consume-binary-data-some-bytes-are-replaced-with-ef-bf-bd/358797
**Category:** Logstash
**Tags:** docker
**Created:** [May 6, 2024, 8:52am UTC](https://discuss.elastic.co/t/when-using-logstash-to-consume-binary-data-some-bytes-are-replaced-with-ef-bf-bd/358797 "2024-05-06T08:52:44Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [May 6, 2024, 12:45pm UTC](https://discuss.elastic.co/t/when-using-logstash-to-consume-binary-data-some-bytes-are-replaced-with-ef-bf-bd/358797/2 "2024-05-06T12:45:06Z")

</div>

> [@imdong](#):
>
> ```auto
> codec => plain {
> charset => "BINARY"
> }
> 
> ```

That tells the codec on the input to translate the data from BINARY to UTF-8. The [code](https://github.com/elastic/logstash/blob/9e452d2e54b42dde88fda35ded438a8030224bce/logstash-core/lib/logstash/util/charset.rb#L33) always outputs UTF-8 because that was all the filters in the pipeline expect.

The ED BD BD is the UTF-8 encoding of the [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) uFFFD. See also [this](https://discuss.elastic.co/t/character-encoding-problems/126714/4) thread.

Perhaps try the ASCII-8BIT encoding?

---

_[View the full topic](https://discuss.elastic.co/t/when-using-logstash-to-consume-binary-data-some-bytes-are-replaced-with-ef-bf-bd/358797)._
