# Logstash errors on imap input multiple languages

**URL:** <https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498>\
**Category:** Logstash\
**Created:** [January 22, 2018, 3:30pm UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498 "2018-01-22T15:30:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![redacted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redacted/32/26199_2.png) [@redacted](https://discuss.elastic.co/u/redacted)\
**Post date:** [January 22, 2018, 3:30pm UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498/1 "2018-01-22T15:30:25Z")

</div>

I am working the the imap plugin and all seems to work well until an email with non english characters comes through. Logstash then fails then restarts.

The error I am seeing is

```
[2018-01-22T10:00:40,212][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will 
restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::IMAP host etc....
Error: 45
Exception: Java::JavaLang::ArrayIndexOutOfBoundsException
Stack: org.jcodings.transcode.TranscodeFunctions.funSioFromGB18030(TranscodeFunctions.java:423)

```

How can I resolve this with not really knowing all the types of characters that will be coming into the mailbox?

TIA

---

<div class="post-metadata">

**Author:** ![redacted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redacted/32/26199_2.png) [@redacted](https://discuss.elastic.co/u/redacted)\
**Post date:** [January 22, 2018, 8:09pm UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498/2 "2018-01-22T20:09:25Z")

</div>

I found more details in the logs

```
  [WARN][logstash.codecs.plain] Received an event that has a different character encoding than you 
  configured. {:text=>"<html>\\n<head>\\n<meta http-equiv=\\\"Content-Type\\\" 
  content=\\\"text/html; charset=Windows-1252\\\">\\n<meta content=\\\"text/html; charset=us-
  ascii\\\">

```

So I assume my emails are coming in using UTF-8, Windows-1252 and us-ascii.

How would I go about having all of these able to be parsed?

I tried entering multiple charset types in my configuration, but I got errors after I added more than 1

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 24, 2018, 11:31am UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498/3 "2018-01-24T11:31:47Z")

</div>

Hi,

What characters are seen via the email bodies that could be thrown up as non English characters? Can you share some examples.  
There are a variety of charsets, so I wonder about the current input characters and if the right charset may resolve here: [https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html)

---

<div class="post-metadata">

**Author:** ![redacted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redacted/32/26199_2.png) [@redacted](https://discuss.elastic.co/u/redacted)\
**Post date:** [January 25, 2018, 6:24pm UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498/4 "2018-01-25T18:24:26Z")

</div>

thanks for the reply, the charsets from what I can tell are

"Windows-1258" and "UTF-8"

I will try and grab some samples.

Is it possible to have both charsets enabled for the imap plugin?

---

<div class="post-metadata">

**Author:** ![redacted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redacted/32/26199_2.png) [@redacted](https://discuss.elastic.co/u/redacted)\
**Post date:** [January 29, 2018, 1:57pm UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498/5 "2018-01-29T13:57:22Z")

</div>

we have gone with an external python program to parse out the messages and send it to logstash

---

<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 26, 2018, 1:57pm UTC](https://discuss.elastic.co/t/logstash-errors-on-imap-input-multiple-languages/116498/6 "2018-02-26T13:57:46Z")

</div>

Closed on February 26, 2018, 1:57pm UTC

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