Closed haqiaolong closed 6 years ago
we came across the same problem . and then fixed with latest fluentd graylog gelf plugin
resolve it simplely as following : step1: generate latest fluentd graylog gelf : gelf-latest.gem step2: generate a docker image
FROM registry.cn-hangzhou.aliyuncs.com/acs-sample/log-pilot:latest
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
COPY plugins/ /etc/fluentd/plugins/
RUN apk update && \
apk add python && \
apk add ruby-json ruby-irb && \
apk add build-base ruby-dev && \
apk add python && \
apk add lsof && \
apk add ca-certificates wget && \
gem install fluentd -v 1.1.3 --no-ri --no-rdoc && \
gem install --local /etc/fluentd/plugins/gelf-latest.gem --no-ri --no-rdoc && \
apk del build-base ruby-dev && \
rm -rf /root/.gem
COPY ./fluentd.tpl /pilot/fluentd.tpl
` step1: generate latest fluentd graylog gelf : gelf-latest.gem
` where can i get this file "gelf-latest.gem" ,or can you send me by email 905883566@qq.com? thank you very much!
gelf-3.0.1.gem.gz just rename gelf-3.0.1.gem.gz to gelf-3.0.1.gem . @loveyang2012 can you download it from this comment?
hi 我用 graylog去收集日志 全英文的没问题 但是包含中文 就报错,报错如下: 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/gelf-3.0.0/lib/gelf/notifier.rb:160:in
encode' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/gelf-3.0.0/lib/gelf/notifier.rb:160:in
to_json' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/gelf-3.0.0/lib/gelf/notifier.rb:160:innotify_with_level!' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/gelf-3.0.0/lib/gelf/notifier.rb:119:in
notify!' 2017-11-12 12:55:42 +0000 [warn]: #0 /etc/fluentd/plugins/out_gelf.rb:119:inblock in write' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/event.rb:323:in
each' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/event.rb:323:inblock in each' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/plugin/buffer/memory_chunk.rb:80:in
open' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/plugin/buffer/memory_chunk.rb:80:inopen' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/event.rb:322:in
each' 2017-11-12 12:55:42 +0000 [warn]: #0 /etc/fluentd/plugins/out_gelf.rb:118:inwrite' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/compat/output.rb:131:in
write' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/plugin/output.rb:1089:intry_flush' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/plugin/output.rb:1314:in
flush_thread_run' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/plugin/output.rb:439:inblock (2 levels) in start' 2017-11-12 12:55:42 +0000 [warn]: #0 /usr/lib/ruby/gems/2.3.0/gems/fluentd-0.14.22/lib/fluent/plugin_helper/thread.rb:78:in
block in thread_create' 2017-11-12 12:55:43 +0000 [warn]: #0 failed to flush the buffer. retry_time=0 next_retry_seconds=2017-11-12 12:55:43 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8" 2017-11-12 12:55:43 +0000 [warn]: #0 suppressed same stacktrace 2017-11-12 12:55:44 +0000 [warn]: #0 failed to flush the buffer. retry_time=1 next_retry_seconds=2017-11-12 12:55:44 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8" 2017-11-12 12:55:44 +0000 [warn]: #0 suppressed same stacktrace 2017-11-12 12:55:46 +0000 [warn]: #0 failed to flush the buffer. retry_time=2 next_retry_seconds=2017-11-12 12:55:46 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8" 2017-11-12 12:55:46 +0000 [warn]: #0 suppressed same stacktrace 2017-11-12 12:55:50 +0000 [warn]: #0 failed to flush the buffer. retry_time=3 next_retry_seconds=2017-11-12 12:55:50 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8" 2017-11-12 12:55:50 +0000 [warn]: #0 suppressed same stacktrace 2017-11-12 12:55:58 +0000 [warn]: #0 failed to flush the buffer. retry_time=4 next_retry_seconds=2017-11-12 12:55:58 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8" 2017-11-12 12:55:58 +0000 [warn]: #0 suppressed same stacktrace ^C^C^C^C2017-11-12 12:56:15 +0000 [warn]: #0 failed to flush the buffer. retry_time=5 next_retry_seconds=2017-11-12 12:56:15 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8" 2017-11-12 12:56:15 +0000 [warn]: #0 suppressed same stacktrace 2017-11-12 12:56:50 +0000 [warn]: #0 failed to flush the buffer. retry_time=6 next_retry_seconds=2017-11-12 12:56:50 +0000 chunk="55dc8aba9dbc2342f98607c506e7f654" error_class=Encoding::UndefinedConversionError error="\"\xE5\" from ASCII-8BIT to UTF-8"