# UTF-8 issue when patterns are loading

**URL:** <https://discuss.elastic.co/t/utf-8-issue-when-patterns-are-loading/25256>\
**Category:** Logstash\
**Created:** [July 9, 2015, 5:54pm UTC](https://discuss.elastic.co/t/utf-8-issue-when-patterns-are-loading/25256 "2015-07-09T17:54:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![incogniro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incogniro/32/5875_2.png) [@incogniro](https://discuss.elastic.co/u/incogniro)\
**Post date:** [July 9, 2015, 5:54pm UTC](https://discuss.elastic.co/t/utf-8-issue-when-patterns-are-loading/25256/1 "2015-07-09T17:54:40Z")

</div>

The pattern files which are read have not been changed in some time. Here is the end of the debug output:

{:timestamp=\>"2015-07-09T18:52:30.171000+0100", :message=\>"Adding pattern", "}"=\>"", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
{:timestamp=\>"2015-07-09T18:52:30.171000+0100", :message=\>"Adding pattern", "}"=\>"", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
{:timestamp=\>"2015-07-09T18:52:30.172000+0100", :message=\>"Adding pattern", "HAPROXYCAPTUREDREQUESTHEADERS"=\>"%{DATA:request\_header\_host}\|%{DATA:request\_header\_x\_forwarded\_for}\|%{DATA:request\_header\_accept\_language}\|%{DATA:request\_header\_referer}\|%{DATA:request\_header\_user\_agent}", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
{:timestamp=\>"2015-07-09T18:52:30.173000+0100", :message=\>"Adding pattern", "HAPROXYCAPTUREDRESPONSEHEADERS"=\>"%{DATA:response\_header\_content\_type}\|%{DATA:response\_header\_content\_encoding}\|%{DATA:response\_header\_cache\_control}\|%{DATA:response\_header\_last\_modified}", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
{:timestamp=\>"2015-07-09T18:52:30.173000+0100", :message=\>"Adding pattern", "HAPROXYHTTP"=\>"%{SYSLOGTIMESTAMP:syslog\_timestamp} %{IPORHOST:syslog\_server} %{SYSLOGPROG}: %{IP:client\_ip}:%{INT:client\_port} \[%{HAPROXYDATE:accept\_date}\] %{NOTSPACE:frontend\_name} %{NOTSPACE:backend\_name}/%{NOTSPACE:server\_name} %{INT:time\_request}/%{INT:time\_queue}/%{INT:time\_backend\_connect}/%{INT:time\_backend\_response}/%{NOTSPACE:time\_duration} %{INT:http\_status\_code} %{NOTSPACE:bytes\_read} %{DATA:captured\_request\_cookie} %{DATA:captured\_response\_cookie} %{NOTSPACE:termination\_state} %{INT:actconn}/%{INT:feconn}/%{INT:beconn}/%{INT:srvconn}/%{NOTSPACE:retries} %{INT:srv\_queue}/%{INT:backend\_queue} (\{%{HAPROXYCAPTUREDREQUESTHEADERS}\})?( )?(\{%{HAPROXYCAPTUREDRESPONSEHEADERS}\})?( )?"(|(%{WORD:http\_verb} (%{URIPROTO:http\_proto}://)?(?:%{USER:http\_user}(?::[^@]_)?@)?(?:%{URIHOST:http\_host})?(?:%{URIPATHPARAM:http\_request})?( HTTP/%{NUMBER:http\_version})?))?"", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
{:timestamp=\>"2015-07-09T18:52:30.174000+0100", :message=\>"Adding pattern", "HAPROXYTCP"=\>"%{SYSLOGTIMESTAMP:syslog\_timestamp} %{IPORHOST:syslog\_server} %{SYSLOGPROG}: %{IP:client\_ip}:%{INT:client\_port} \[%{HAPROXYDATE:accept\_date}\] %{NOTSPACE:frontend\_name} %{NOTSPACE:backend\_name}/%{NOTSPACE:server\_name} %{INT:time\_queue}/%{INT:time\_backend\_connect}/%{NOTSPACE:time\_duration} %{NOTSPACE:bytes\_read} %{NOTSPACE:termination\_state} %{INT:actconn}/%{INT:feconn}/%{INT:beconn}/%{INT:srvconn}/%{NOTSPACE:retries} %{INT:srv\_queue}/%{INT:backend\_queue}", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
{:timestamp=\>"2015-07-09T18:52:30.175000+0100", :message=\>"Adding pattern", "JAVAEXCEPTION"=\>"(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s_Caused by:.+)", :level=\>:info, :file=\>"/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb", :line=\>"62", :method=\>"add\_pattern"}  
The error reported is:  
invalid byte sequence in UTF-8  
org/jruby/RubyRegexp.java:1657:in `=~' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:72:in`add\_patterns\_from\_file'  
org/jruby/RubyIO.java:3542:in `each' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:70:in`add\_patterns\_from\_file'  
C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:361:in `add_patterns_from_files' org/jruby/RubyArray.java:1613:in`each'  
C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:357:in `add_patterns_from_files' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:269:in`register'  
org/jruby/RubyArray.java:1613:in `each' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:265:in`register'  
org/jruby/RubyHash.java:1341:in `each' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-grok-1.0.0/lib/logstash/filters/grok.rb:261:in`register'  
org/jruby/RubyArray.java:1613:in `each' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:154:in`start\_filters'  
C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:81:in `run' C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/agent.rb:150:in`execute'  
C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/runner.rb:91:in `run' org/jruby/RubyProc.java:271:in`call'  
C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/runner.rb:96:in `run' org/jruby/RubyProc.java:271:in`call'  
C:/Programs/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.20/lib/stud/task.rb:12:in `initialize'

---

<div class="post-metadata">

**Author:** ![incogniro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incogniro/32/5875_2.png) [@incogniro](https://discuss.elastic.co/u/incogniro)\
**Post date:** [July 10, 2015, 8:34am UTC](https://discuss.elastic.co/t/utf-8-issue-when-patterns-are-loading/25256/2 "2015-07-10T08:34:37Z")

</div>

No action required, another file was in the patterns directory causing this issue.

---

<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:35am UTC](https://discuss.elastic.co/t/utf-8-issue-when-patterns-are-loading/25256/3 "2017-07-06T05:35:02Z")

</div>


