# Chinese Characters in Grok

**URL:** <https://discuss.elastic.co/t/chinese-characters-in-grok/40314>\
**Category:** Logstash\
**Created:** [January 28, 2016, 2:55am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314 "2016-01-28T02:55:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [January 28, 2016, 2:55am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/1 "2016-01-28T02:55:20Z")

</div>

I have a log that is in Chinese. An example will be

2016-01-20T17:27:22+08:00 Server1 日志类型:电脑操作, 用户:user12

I have created a grok pattern for parsing this log. I verified it in [https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/)

The problem now is that I got this error when I am running Logstash  
"Error: Expected one of #, input, filter, output at line 1, column 1 (byte 1) after"

Once I remove the Chinese characters in the grok pattern Logstash will be able to run

How should I resolve this?

---

<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:** [January 28, 2016, 7:00am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/2 "2016-01-28T07:00:35Z")

</div>

Is your configuration file UTF-8? No byte order marks at the beginning of the file? It would help if you posted your configuration (format it as code when you paste it) and the output of `hexdump -C your-file.conf | head`.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [January 28, 2016, 7:35am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/3 "2016-01-28T07:35:09Z")

</div>

I have saved it in UTF-8 format.

I am running it on Windows

---

<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:** [January 28, 2016, 8:23am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/4 "2016-01-28T08:23:29Z")

</div>

Make sure there is no byte order mark at the beginning of the file. You can use any hex editor for that.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [January 28, 2016, 8:29am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/5 "2016-01-28T08:29:29Z")

</div>

So I'll need to hex the log file as well?

---

<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:** [January 28, 2016, 8:44am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/6 "2016-01-28T08:44:18Z")

</div>

No! I'm just suggesting that you check that there's no [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark) at the beginning of the configuration file.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [February 11, 2016, 7:10am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/7 "2016-02-11T07:10:39Z")

</div>

Problem solve. Thanks for your advise:relaxed:

---

<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:** [July 6, 2017, 5:12am UTC](https://discuss.elastic.co/t/chinese-characters-in-grok/40314/8 "2017-07-06T05:12:06Z")

</div>


