# Warn : expected UTF-8

**URL:** <https://discuss.elastic.co/t/warn-expected-utf-8/94616>\
**Category:** Logstash\
**Created:** [July 26, 2017, 10:23am UTC](https://discuss.elastic.co/t/warn-expected-utf-8/94616 "2017-07-26T10:23:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marwa](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@marwa](https://discuss.elastic.co/u/marwa)\
**Post date:** [July 26, 2017, 10:23am UTC](https://discuss.elastic.co/t/warn-expected-utf-8/94616/1 "2017-07-26T10:23:21Z")

</div>

i wanted to load data from logsatsh into elasticsearch , this is a sample of my data

 ![](https://us1.discourse-cdn.com/elastic/original/3X/5/3/534c0b4ed4b37d8ff2b08ab1c39a662482f51f97.png)product-name,price,number\_of\_customers,general\_feddback,promotion\_period,percentage\_promotion,number\_of\_customers\_after\_promotion,categorie\_produit  
Taillefine aux fruits 0% Fraise - Danone - 500 g (4 x 125 g),556.26,481018,3,10-10-2016,22,516292.653333333,yaourt  
Activia Fibre - Danone - 171,5 g (150 g+21,5 g),612.98,961714,2,4-8-2016,32,1064296.82666667,yaourt  
Taillefine Yaourt Nature - Danone - 1,5 kg e (12 \* 125 g),254.07,845922,4,11-4-2016,39,955891.86,yaourt  
Activia Noix de Coco - Danone - 650 g,256.19,497515,1,1-14-2016,25,538974.583333333,yaourt  
Danio Raspberry - danone - 160g,312.67,581307,5,3-17-2017,17,614247.73,yaourt  
Fjørd nature - Danone - 500 g, 4 pots de 125 g,425.59,878459,4,8-26-2016,26,954592.113333333,yaourt

this the config file  
input {  
file {  
path =\> "/opt/logstash-5.5.0/data/es\_data\_base.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}

filter {  
csv {  
separator =\> ","  
#product-name,price,number\_of\_customers,general\_feddback,promotion\_period,percentage\_promotion,number\_of\_customers\_after\_promotion,categorie\_produit  
columns =\> ["product-name","price","number\_of\_customers","general\_feddback","promotion\_period","percentage\_promotion","number\_of\_customers\_after\_promotion","categorie\_produit"]  
}  
}

output {  
elasticsearch {  
hosts =\> "[http://197.12.8.3:9200](http://197.12.8.3:9200)"  
index =\> "es\_retails"  
}  
stdout {}  
}

this warn appeared :

Received an event that has a different character encoding than you configured. {:text=\>"Ketchup - Jardin Bio' - 560\xA0g,2784.03,18174,3,1-7-2016,26,3025.3126,salami\_viande", :expected\_charset=\>"UTF-8"}

how to fix it !!! any help please

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 26, 2017, 10:46am UTC](https://discuss.elastic.co/t/warn-expected-utf-8/94616/2 "2017-07-26T10:46:45Z")

</div>

Find out what character set your data is in and set the `charset` option like this:

```nohighlight
input {
  file {
    ...
    codec => plain {
      charset => "name of charset here"
    }
  }
}

```

See [https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-plain.html) for a list of available character sets.

---

<div class="post-metadata">

**Author:** ![marwa](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@marwa](https://discuss.elastic.co/u/marwa)\
**Post date:** [July 26, 2017, 11:34am UTC](https://discuss.elastic.co/t/warn-expected-utf-8/94616/3 "2017-07-26T11:34:49Z")

</div>

i did used ISO-8859-1 and everything worked very well but i still don't undestand what does it means can you explain it for me ??

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 2, 2017, 6:44pm UTC](https://discuss.elastic.co/t/warn-expected-utf-8/94616/4 "2017-08-02T18:44:36Z")

</div>

You configured Logstash to interpret the input file as ISO8859-1 instead of UTF-8, and then the bits and bytes of the file make sense.

---

<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:** [August 30, 2017, 6:44pm UTC](https://discuss.elastic.co/t/warn-expected-utf-8/94616/5 "2017-08-30T18:44:44Z")

</div>

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