Skip to content

Commit

Permalink
Merge pull request #306 from tongpu/feature_use_fluent-plugin-remote_…
Browse files Browse the repository at this point in the history
…syslog

use fluent-plugin-remote_syslog for fluentd v1.x
  • Loading branch information
repeatedly authored May 7, 2019
2 parents eb47f02 + 1a71476 commit 8094eac
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docker-image/v1.3/debian-syslog/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem "fluent-plugin-concat", "~> 2.3.0"
gem "fluent-plugin-grok-parser", "~> 2.5.0"
gem "fluent-plugin-prometheus", "~> 1.3.0"
gem "fluent-plugin-rewrite-tag-filter", "~> 2.1.0"
gem "fluent-plugin-kubernetes_remote_syslog"
gem "fluent-plugin-remote_syslog"
gem "fluent-plugin-kubernetes_metadata_filter", "~> 2.1.4"
gem "ffi"
gem "fluent-plugin-systemd", "~> 1.0.1"
23 changes: 5 additions & 18 deletions docker-image/v1.3/debian-syslog/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ GEM
ffi (1.10.0)
fluent-config-regexp-type (1.0.0)
fluentd (> 1.0.0, < 2)
fluent-mixin-config-placeholders (0.4.0)
fluentd
uuidtools (>= 2.1.5)
fluent-mixin-plaintextformatter (0.2.6)
fluentd
ltsv
fluent-mixin-rewrite-tag-name (0.1.0)
fluentd
fluent-plugin-concat (2.3.0)
fluentd (>= 0.14.0, < 2)
fluent-plugin-grok-parser (2.5.1)
Expand All @@ -32,17 +24,14 @@ GEM
fluentd (>= 0.14.0, < 2)
kubeclient (~> 1.1.4)
lru_redux
fluent-plugin-kubernetes_remote_syslog (0.3.6)
fluent-mixin-config-placeholders
fluent-mixin-plaintextformatter
fluent-mixin-rewrite-tag-name
fluentd
remote_syslog_sender (~> 1.2.1)
fluent-plugin-multi-format-parser (1.0.0)
fluentd (>= 0.14.0, < 2)
fluent-plugin-prometheus (1.3.0)
fluentd (>= 0.14.20, < 2)
prometheus-client
fluent-plugin-remote_syslog (1.0.0)
fluentd
remote_syslog_sender (>= 1.1.1)
fluent-plugin-rewrite-tag-filter (2.1.1)
fluent-config-regexp-type
fluentd (>= 0.14.2, < 2)
Expand Down Expand Up @@ -77,7 +66,6 @@ GEM
recursive-open-struct (= 1.0.0)
rest-client
lru_redux (1.1.0)
ltsv (0.1.2)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
Expand All @@ -96,7 +84,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
serverengine (2.1.0)
serverengine (2.1.1)
sigdump (~> 0.2.2)
sigdump (0.2.4)
strptime (0.2.3)
Expand All @@ -111,7 +99,6 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
uuidtools (2.1.5)
yajl-ruby (1.4.1)

PLATFORMS
Expand All @@ -122,9 +109,9 @@ DEPENDENCIES
fluent-plugin-concat (~> 2.3.0)
fluent-plugin-grok-parser (~> 2.5.0)
fluent-plugin-kubernetes_metadata_filter (~> 2.1.4)
fluent-plugin-kubernetes_remote_syslog
fluent-plugin-multi-format-parser (~> 1.0.0)
fluent-plugin-prometheus (~> 1.3.0)
fluent-plugin-remote_syslog
fluent-plugin-rewrite-tag-filter (~> 2.1.0)
fluent-plugin-systemd (~> 1.0.1)
fluentd (= 1.3.3)
Expand Down
17 changes: 14 additions & 3 deletions docker-image/v1.3/debian-syslog/conf/fluent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@
@include conf.d/*.conf

<match **>
@type kubernetes_remote_syslog
@type remote_syslog
@id out_kube_remote_syslog
host "#{ENV['SYSLOG_HOST']}"
port "#{ENV['SYSLOG_PORT']}"
severity debug
tag fluentd
program fluentd
hostname ${kubernetes_host}

protocol "#{ENV['SYSLOG_PROTOCOL'] || 'tcp'}"
tls "#{ENV['SYSLOG_TLS'] || 'false'}"
ca_file "#{ENV['SYSLOG_CA_FILE'] || ''}"
verify_mode "#{ENV['SYSLOG_VERIFY_MODE'] || ''}"
packet_size 65535
output_data_type ltsv

<buffer kubernetes_host>
</buffer>

<format>
@type ltsv
</format>
</match>

4 changes: 4 additions & 0 deletions templates/Gemfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ gem "fluent-plugin-papertrail", "~> 0.2.6"
gem "fluent-plugin-papertrail"
<% end %>
<% when "syslog" %>
<% if is_v1 %>
gem "fluent-plugin-remote_syslog"
<% else %>
gem "fluent-plugin-kubernetes_remote_syslog"
<% end %>
<% when "kafka" %>
gem "fluent-plugin-kafka", "~> 0.7.9"
gem "zookeeper", "~> 1.4.11"
Expand Down
34 changes: 31 additions & 3 deletions templates/conf/fluent.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,45 @@
</match>

<% when "syslog" %>
<% if is_v1 %>
<match **>
@type kubernetes_remote_syslog
@type remote_syslog
@id out_kube_remote_syslog
host "#{ENV['SYSLOG_HOST']}"
port "#{ENV['SYSLOG_PORT']}"
severity debug
tag fluentd
protocol "#{ENV['SYSLOG_PROTOCOL'] || 'tcp'}"
program fluentd
hostname ${kubernetes_host}

protocol "#{ENV['SYSLOG_PROTOCOL'] || 'tcp'}"
tls "#{ENV['SYSLOG_TLS'] || 'false'}"
ca_file "#{ENV['SYSLOG_CA_FILE'] || ''}"
verify_mode "#{ENV['SYSLOG_VERIFY_MODE'] || ''}"
packet_size 65535

<buffer kubernetes_host>
</buffer>

<format>
@type ltsv
</format>
</match>
<% else %>
<match **>
@type kubernetes_remote_syslog
@id out_kube_remote_syslog
host "#{ENV['SYSLOG_HOST']}"
port "#{ENV['SYSLOG_PORT']}"
facility "#{ENV['SYSLOG_FACILITY'] || 'user'}"
severity "#{ENV['SYSLOG_SEVERITY'] || 'debug'}"
tag "#{ENV['SYSLOG_TAG'] || 'fluentd'}"
protocol "#{ENV['SYSLOG_PROTOCOL'] || 'tcp'}"
tls "#{ENV['SYSLOG_TLS'] || 'false'}"
ca_file "#{ENV['SYSLOG_CA_FILE'] || ''}"
packet_size 65535
output_data_type ltsv
</match>
<% end %>
<% when "forward" %>
<match **>
Expand Down

0 comments on commit 8094eac

Please sign in to comment.