# Imap Plugin Parsing Error

**URL:** <https://discuss.elastic.co/t/imap-plugin-parsing-error/232569>\
**Category:** Logstash\
**Created:** [May 14, 2020, 7:25am UTC](https://discuss.elastic.co/t/imap-plugin-parsing-error/232569 "2020-05-14T07:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano\_Serano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefano_serano/32/68310_2.png) [@Stefano\_Serano](https://discuss.elastic.co/u/Stefano_Serano)\
**Post date:** [May 14, 2020, 7:25am UTC](https://discuss.elastic.co/t/imap-plugin-parsing-error/232569/1 "2020-05-14T07:25:33Z")

</div>

Hi all.  
I've configured logstash multiple input:

Filebeat Input  
Imap Plugin Input

and output to two different Elasticsearch index.

After upgrade form 7.2 to 7.6 logstash not index mails anymore prompting this error:

_:exception=\>#\<LogStash::Json::ParserError: Unrecognized token 'dsfwdfqwd': was expecting ('true', 'false' or 'null')  
at [Source: (byte)" Message Body_

**_Message Body_ = Any message i put in mail body.**

So, i think logstash is trying to parsing Json instead using ruby codex. my first impression is that logstash is using the wrong output, but i'm not sure. Here my configuration:  
'''

# Imap Input

input {  
imap {  
host =\> "host.domain.it"  
password =\> "mypw"  
user =\> "mymail"  
port=\> 143  
secure=\>"false"  
check\_interval =\> 10  
tags =\> ["emails"]  
}  
}

# Wazuh Input

input {  
beats {  
port =\> 5000

```
}

```

}

output {  
if "emails" in [tags] {  
stdout { codec =\> rubydebug }  
elasticsearch {  
index =\> "email-monitoring"  
document\_type =\> "email"  
hosts =\> "127.0.0.1:9200"  
}  
}  
if "emails" not in [tags] {  
elasticsearch {  
hosts =\> ["127.0.0.1:9200"]  
index =\> "wazuh-alerts-3.x-%{+YYYY.MM.dd}"

```
 }

```

}  
}  
'''  
If i remove the filebeat configuration mails are indexed correctly

Hope someone can help me figured out the problem.

---

<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:** [June 11, 2020, 7:25am UTC](https://discuss.elastic.co/t/imap-plugin-parsing-error/232569/2 "2020-06-11T07:25:40Z")

</div>

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