# Change character encoding in Logstash

**URL:** <https://discuss.elastic.co/t/change-character-encoding-in-logstash/153806>\
**Category:** Logstash\
**Created:** [October 24, 2018, 1:12pm UTC](https://discuss.elastic.co/t/change-character-encoding-in-logstash/153806 "2018-10-24T13:12:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [October 24, 2018, 1:12pm UTC](https://discuss.elastic.co/t/change-character-encoding-in-logstash/153806/1 "2018-10-24T13:12:05Z")

</div>

How to specify the character encoding as UTF 16 or ASCII in logstash?

My input section as below. I am reading a CSV file using CSV plugin in filter section

```
input {

	file {
			path => "C:/ITIL_Incidents.csv"                              
			start_position => "beginning"
			                    
		}
	}
```

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [October 25, 2018, 7:19am UTC](https://discuss.elastic.co/t/change-character-encoding-in-logstash/153806/2 "2018-10-25T07:19:08Z")

</div>

hello varun,  
for what purpose do you need to change the character encoding,

check below code to load csv file,

> [@Load csv file in logstash](https://discuss.elastic.co/t/load-csv-file-in-logstash/151319/3):
>
> Thanks for reply,hope this works fine, input { file { path =\> "D:/Balu/ELK-stack/csvfile.csv" start\_position =\> "beginning" sincedb\_path =\> "NUL" } } filter { csv { separator =\> "," columns =\> ["open","high","low","close","volume"] } } output { elasticsearch { hosts =\> "[http://localhost:9200](http://localhost:9200)" index =\> "wallet-address-index" } stdout { codec =\> rubydebug } }

---

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [October 25, 2018, 7:09pm UTC](https://discuss.elastic.co/t/change-character-encoding-in-logstash/153806/3 "2018-10-25T19:09:28Z")

</div>

because my csv file contains non utf-8 characters like Latin letters. so when I try to index in logstash, it is giving error for indexing non utf 8 fields

---

<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:** [November 22, 2018, 7:09pm UTC](https://discuss.elastic.co/t/change-character-encoding-in-logstash/153806/4 "2018-11-22T19:09:31Z")

</div>

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