# Input file codec json UTF-16 parse error

**URL:** https://discuss.elastic.co/t/input-file-codec-json-utf-16-parse-error/70778
**Category:** Logstash
**Created:** [January 6, 2017, 11:08am UTC](https://discuss.elastic.co/t/input-file-codec-json-utf-16-parse-error/70778 "2017-01-06T11:08:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sungjun](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sungjun](https://discuss.elastic.co/u/sungjun)
#### Post date: [January 6, 2017, 11:08am UTC](https://discuss.elastic.co/t/input-file-codec-json-utf-16-parse-error/70778/1 "2017-01-06T11:08:18Z")

</div>

Hi i am korean. We used logstash on a windows server.  
logs are written in utf-16.  
but Logstash does not correctly interpret json except the first line.

this is config file

```
input {
  file {
    path =>
    start_position => 'beginning'
    codec => json {
      charset => 'UTF-16'
    }
  }
}
output {
  file {
    path =>
    codec => json_lines {
      charset => 'UTF-8'
    }
  }
}

```

and error message

> [2017-01-06T08:55:59,899][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=\>#\<LogStash::Json::ParserError: Unexpected character ('L' (code 76)): was expecting comma to separate OBJECT entries  
> at [Source: {"TimeStamp":"2017-01-06 15:57:51","Action":"LOGOUT","Uid":698,"NickName":"Â¸í��ì�´ì�¤ì�¢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}ï¿½; line: 1, column: 84]\>, :data=\>"{"TimeStamp":"2017-01-06 15:57:51","Action":"LOGOUT","Uid":698,"NickName":"¸퉀왴잤숢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�"}  
> {"Action":"LOGIN","Description":"test","NickName":"트와이스","Cash":0,"TimeStamp":"2017-01-06 15:56:52","tags":,"Uid":698,"Coin":0,"path":"/home/ec2-user/USER/UTF16.json","ServerID":0,"@timestamp":"2017-01-06T08:55:59.882Z","@version":"1","host":"ip-172-31-14-82","Level":1,"Exp":0}  
> [2017-01-06T08:55:59,989][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=\>#\<LogStash::Json::ParserError: Unexpected character ('L' (code 76)): was expecting comma to separate OBJECT entries  
> at [Source: {"TimeStamp":"2017-01-06 16:02:02","Action":"LOGIN","Uid":607,"NickName":"hí��ê¹�í��ì��ê°¢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}ï¿½; line: 1, column: 84]\>, :data=\>"{"TimeStamp":"2017-01-06 16:02:02","Action":"LOGIN","Uid":607,"NickName":"h험깜헜숄갢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�"}  
> [2017-01-06T08:55:59,992][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=\>#\<LogStash::Json::ParserError: Unexpected character ('L' (code 76)): was expecting comma to separate OBJECT entries  
> at [Source: {"TimeStamp":"2017-01-06 16:02:20","Action":"LOGIN","Uid":801,"NickName":"Ã�ì��í��ë��í�¢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}ï¿½; line: 1, column: 83]\>, :data=\>"{"TimeStamp":"2017-01-06 16:02:20","Action":"LOGIN","Uid":801,"NickName":"Ì옄햙럈퀢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�"}  
> [2017-01-06T08:55:59,995][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=\>#\<LogStash::Json::ParserError: Unexpected character ('L' (code 76)): was expecting comma to separate OBJECT entries  
> at [Source: {"TimeStamp":"2017-01-06 16:04:06","Action":"LOGIN","Uid":595,"NickName":"Â¨ë�©ì��í�¢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}ï¿½; line: 1, column: 82]\>, :data=\>"{"TimeStamp":"2017-01-06 16:04:06","Action":"LOGIN","Uid":595,"NickName":"¨납옄혢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�"}  
> {"path":"/home/ec2-user/USER/UTF16.json","@timestamp":"2017-01-06T08:55:59.920Z","@version":"1","host":"ip-172-31-14-82","message":"{"TimeStamp":"2017-01-06 15:57:51","Action":"LOGOUT","Uid":698,"NickName":"¸퉀왴잤숢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�","tags":["\_jsonparsefailure"]}

and output file

> {"Action":"LOGOUT","Description":"test","NickName":"트와이스","Cash":0,"TimeStamp":"2017-01-06 15:57:51","tags":,"Uid":698,"Coin":0,"path":"D:/USER\_20170106\_155652\_0000.json","ServerID":0,"@timestamp":"2017-01-06T09:00:46.491Z","@version":"1","host":"WP-SUNGJUN","Level":1,"Exp":0}  
> {"path":"D:/USER\_20170106\_155652\_0000.json","@timestamp":"2017-01-06T09:00:49.594Z","@version":"1","host":"WP-SUNGJUN","message":"{"TimeStamp":"2017-01-06 16:02:02","Action":"LOGIN","Uid":607,"NickName":"h험깜헜숄갢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�","tags":["\_jsonparsefailure"]}  
> {"path":"D:/USER\_20170106\_155652\_0000.json","@timestamp":"2017-01-06T09:00:49.602Z","@version":"1","host":"WP-SUNGJUN","message":"{"TimeStamp":"2017-01-06 16:02:20","Action":"LOGIN","Uid":801,"NickName":"Ì옄햙럈퀢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�","tags":["\_jsonparsefailure"]}  
> {"Action":"LOGIN","Description":"test","NickName":"soulaby","Cash":0,"TimeStamp":"2017-01-06 16:04:03","tags":,"Uid":250,"Coin":0,"path":"D:/USER\_20170106\_155652\_0000.json","ServerID":0,"@timestamp":"2017-01-06T09:00:49.658Z","@version":"1","host":"WP-SUNGJUN","Level":1,"Exp":0}  
> {"path":"D:/USER\_20170106\_155652\_0000.json","@timestamp":"2017-01-06T09:00:49.662Z","@version":"1","host":"WP-SUNGJUN","message":"{"TimeStamp":"2017-01-06 16:04:06","Action":"LOGIN","Uid":595,"NickName":"¨납옄혢,"Level":1,"Exp":0,"Coin":0,"Cash":0,"ServerID":0,"Description":"test"}�","tags":["\_jsonparsefailure"]}

i want solution.

---

<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 3, 2017, 11:08am UTC](https://discuss.elastic.co/t/input-file-codec-json-utf-16-parse-error/70778/2 "2017-02-03T11:08:18Z")

</div>

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