# Logstash 6.0 http input not accepting utf-8

**URL:** https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731
**Category:** Logstash
**Created:** [November 15, 2017, 11:39am UTC](https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731 "2017-11-15T11:39:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Conall\_Prendergast](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@Conall\_Prendergast](https://discuss.elastic.co/u/Conall_Prendergast)
#### Post date: [November 15, 2017, 11:39am UTC](https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731/1 "2017-11-15T11:39:10Z")

</div>

Hi,

I have a logstash pipeline with a http input plugin. I want to use a json codec but this fails when the input contains the character "é".

This fails with the error:

```auto
[ERROR] 2017-11-15 11:32:24.663 [Ruby-0-Thread-22: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/thread_pool.rb:61] json - JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: Unexpected character ('\' (code 92)): was expecting double-quote to start field name

```

This is because the input then no longer looks like json, and goes from

```
{\"key\": \"Ascii text with e\"}

```

to

```
{\\\"key\\\": \\\"Non ascii text with \\xE9\\\"}

```

The difference between the two messages above are the fact that the latter contains the character é.

how can I force the http input plugin to accept utf-8?

I already have the collowing line in my config, but it does not work:

```
codec => json { charset => "UTF-8" }

```

Thanks

LS 6.0 rc2

---

<div class="post-metadata">

### Author: ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)
#### Post date: [November 15, 2017, 3:14pm UTC](https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731/2 "2017-11-15T15:14:29Z")

</div>

You are hitting this bug. [https://github.com/elastic/logstash/issues/4560](https://github.com/elastic/logstash/issues/4560)

Have you tried to remove the `charset` setting?

e.g.

```auto
codec => json { }

```

The charset setting is more useful when the incoming character set is **not** UTF-8 already.

---

<div class="post-metadata">

### Author: ![Conall\_Prendergast](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@Conall\_Prendergast](https://discuss.elastic.co/u/Conall_Prendergast)
#### Post date: [November 15, 2017, 3:34pm UTC](https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731/3 "2017-11-15T15:34:02Z")

</div>

Thanks.  
I added

```
codec => json {charset => "ISO-8859-1"}

```

to match the other end, even though I wanted it to use UTF-8. But it seems to work now.  
Thanks

---

<div class="post-metadata">

### Author: ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)
#### Post date: [November 15, 2017, 3:36pm UTC](https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731/4 "2017-11-15T15:36:26Z")

</div>

Yes. the charset setting is a **from** not a **to** value. The unwritten `to` charset is always UTF-8.

---

<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: [December 13, 2017, 3:36pm UTC](https://discuss.elastic.co/t/logstash-6-0-http-input-not-accepting-utf-8/107731/5 "2017-12-13T15:36:53Z")

</div>

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