# How to set charset in input, filter and output in logstash conf fille

**URL:** <https://discuss.elastic.co/t/how-to-set-charset-in-input-filter-and-output-in-logstash-conf-fille/122843>\
**Category:** Logstash\
**Created:** [March 7, 2018, 8:19am UTC](https://discuss.elastic.co/t/how-to-set-charset-in-input-filter-and-output-in-logstash-conf-fille/122843 "2018-03-07T08:19:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzarrabi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hzarrabi](https://discuss.elastic.co/u/hzarrabi)\
**Post date:** [March 7, 2018, 8:19am UTC](https://discuss.elastic.co/t/how-to-set-charset-in-input-filter-and-output-in-logstash-conf-fille/122843/1 "2018-03-07T08:19:48Z")

</div>

Hi,

I have in my logstash-plain.log this kind of log :

`[2018-03-07T09:02:28,053][WARN][logstash.codecs.multiline] Received an event that has a different character encoding than you configured. {:text=>"\\u00002\\u00000\\u00001\\u00008\\u0000-\\u00000\\u00003\\u0000-\\u00000\\u00006\\u0000 \\u00001\\u00002\\u0000:\\u00002\\u00003\\u0000:\\u00001\\u00001\\u0000 \\u0000I\\u0000N\\u0000F\\u0000O\\u0000 \\u0000 \\u0000[\\u0000C\\u0000u\\u0000s\\u0000t\\u0000o\\u0000m\\u0000i\\u0000s\\u0000e\\u0000d\\u0000C\\u0000o\\u0000n\\u0000t\\u0000r\\u0000a\\u0000c\\u0000t\\u0000O\\u0000v\\u0000e\\u0000r\\u0000v\\u0000i\\u0000e\\u0000w\\u0000.\\u0000p\\u0000r\\u0000o\\u0000c\\u0000e\\u0000s\\u0000s\\u0000P\\u0000a\\u0000g\\u0000e\\u0000]\\u0000 \\u0000D\\u0000u\\x88t\\u0000 \\u0000p\\u0000r\\u0000o\\u0000c\\u0000e\\u0000s\\u0000s\\u0000P\\u0000a\\u0000g\\u0000e\\u0000", :expected_charset=>"UTF-8"}`

I have different kind of file charset.  
This one is in " **Little-endian UTF-16 Unicode text**"  
and I'm using also :

```
codec => multiline {
    pattern => "^(%{YEAR}.%{MONTHNUM}.%{MONTHDAY}\s*%{HOUR}:?%{MINUTE}(?::?%{SECOND}))"
    negate => true
    what => "previous"
    charset => "UTF-16"
}

```

Do you have any idea how to set the charset and where ?

Regards

---

<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:** [April 4, 2018, 8:19am UTC](https://discuss.elastic.co/t/how-to-set-charset-in-input-filter-and-output-in-logstash-conf-fille/122843/2 "2018-04-04T08:19:51Z")

</div>

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