# Logstash UTF-16 codepoint \[0x0\] at position 0 is a reserved character

**URL:** <https://discuss.elastic.co/t/logstash-utf-16-codepoint-0x0-at-position-0-is-a-reserved-character/217810>\
**Category:** Logstash\
**Created:** [February 4, 2020, 1:24pm UTC](https://discuss.elastic.co/t/logstash-utf-16-codepoint-0x0-at-position-0-is-a-reserved-character/217810 "2020-02-04T13:24:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devopselk](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@devopselk](https://discuss.elastic.co/u/devopselk)\
**Post date:** [February 4, 2020, 1:24pm UTC](https://discuss.elastic.co/t/logstash-utf-16-codepoint-0x0-at-position-0-is-a-reserved-character/217810/1 "2020-02-04T13:24:21Z")

</div>

Hello everyone,

I transfer data from an elasticsearch to another elasticsearch with logstash.  
I am using codec but could not solve the UTF problem.

**My Config**  
elasticsearch {

```
codec => json {

  charset => "UTF-16"

}

hosts => ["http://localhost:9200"]

index => "indexname"

user => "username"

password => "password"

```

}

}

filter {

```
mutate {

    rename => { "fieldname" => "[newfieldname]" }

}

```

}

output {

elasticsearch {

```
hosts => ["http://localhost:9201"]

index => "sampleindex"

user => "username"

password => "password"

```

}

}

**ERROR**

[2020-02-04T15:01:56,574][WARN][logstash.outputs.elasticsearch][main] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>"sdfsdcacascasdasd", :\_index=\>"sampleindex", :routing=\>nil, :\_type=\>"\_doc"}, #LogStash::Event:0x155796f5], :response=\>{"index"=\>{"\_index"=\>"sampleindex", "\_type"=\>"\_doc", "\_id"=\>"sdfsdcacascasdasd", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Illegal input [\u0000\u0000,] UTF-16 codepoint [0x0] at position 0 is a reserved character"}}}}}

---

<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:** [March 3, 2020, 1:24pm UTC](https://discuss.elastic.co/t/logstash-utf-16-codepoint-0x0-at-position-0-is-a-reserved-character/217810/2 "2020-03-03T13:24:23Z")

</div>

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