Skip to content

Commit

Permalink
Use record_modifier to fix encoding for graylog
Browse files Browse the repository at this point in the history
  • Loading branch information
zrochler committed Feb 28, 2019
1 parent 25cc7a1 commit f3d355b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions docker-image/v1.3/debian-graylog/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem "fluent-plugin-concat", "~> 2.3.0"
gem "fluent-plugin-rewrite-tag-filter", "~> 2.1.0"
gem "gelf", "3.0.0"
gem "fluent-plugin-gelf-hs", "~> 1.0.7"
gem "fluent-plugin-record-modifier", "~> 2.0.0"
gem "fluent-plugin-kubernetes_metadata_filter", "~> 2.1.4"
gem "ffi"
gem "fluent-plugin-systemd", "~> 1.0.1"
7 changes: 5 additions & 2 deletions docker-image/v1.3/debian-graylog/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ GEM
lru_redux
fluent-plugin-multi-format-parser (1.0.0)
fluentd (>= 0.14.0, < 2)
fluent-plugin-record-modifier (2.0.1)
fluentd (>= 1.0, < 2)
fluent-plugin-rewrite-tag-filter (2.1.1)
fluent-config-regexp-type
fluentd (>= 0.14.2, < 2)
Expand Down Expand Up @@ -57,7 +59,7 @@ GEM
http_parser.rb (0.6.0)
i18n (1.5.3)
concurrent-ruby (~> 1.0)
json (2.1.0)
json (2.2.0)
kubeclient (1.1.4)
activesupport
http (= 0.9.8)
Expand Down Expand Up @@ -102,11 +104,12 @@ DEPENDENCIES
fluent-plugin-gelf-hs (~> 1.0.7)
fluent-plugin-kubernetes_metadata_filter (~> 2.1.4)
fluent-plugin-multi-format-parser (~> 1.0.0)
fluent-plugin-record-modifier (~> 2.0.0)
fluent-plugin-rewrite-tag-filter (~> 2.1.0)
fluent-plugin-systemd (~> 1.0.1)
fluentd (= 1.3.3)
gelf (= 3.0.0)
oj (= 3.5.1)

BUNDLED WITH
1.16.1
1.17.2
6 changes: 6 additions & 0 deletions docker-image/v1.3/debian-graylog/conf/fluent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
@include kubernetes.conf
@include conf.d/*.conf

# The gelf plugin assumes input in utf-8
<filter **>
@type record_modifier
char_encoding utf-8
</filter>

<match **>
@type gelf
@id out_graylog
Expand Down
4 changes: 3 additions & 1 deletion templates/Gemfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ gem "fluent-plugin-gcs", "~> 0.3"
gem "gelf", "3.0.0"
<% if is_v1 %>
gem "fluent-plugin-gelf-hs", "~> 1.0.7"
gem "fluent-plugin-record-modifier", "~> 2.0.0"
<% else %>
gem "fluent-plugin-gelf-hs"
gem "fluent-plugin-record-modifier", "< 1.0.0"
<% end %>
<% when "logzio" %>
<% if is_v1 %>
Expand Down Expand Up @@ -93,7 +95,7 @@ gem "fluent-plugin-splunk-enterprise"
<% if is_v1 %>
gem "fluent-plugin-kubernetes_metadata_filter", "~> 2.1.4"
<% else %>
gem "fluent-plugin-kubernetes_metadata_filter"
gem "fluent-plugin-kubernetes_metadata_filter", "< 1.0.0"
<% end %>
<% if !is_alpine %>
gem "ffi"
Expand Down
6 changes: 6 additions & 0 deletions templates/conf/fluent.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@
num_threads 2
</match>
<% when "graylog"%>
# The gelf plugin assumes input in utf-8
<filter **>
@type record_modifier
char_encoding utf-8
</filter>

<match **>
@type gelf
@id out_graylog
Expand Down

0 comments on commit f3d355b

Please sign in to comment.