fluent-plugin-gelf-test 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fluent/plugin/out_gelf.rb +14 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a3a61aabe9d35fce2c7f0c9b3314f75e524fce2d3c953c7625a6b821858c470
4
- data.tar.gz: b675cb1e5fbba9752476cb159b5360de8083bd12c46e430a22b611371ee25aeb
3
+ metadata.gz: c1408d928adbef9988d61d6b26f28cca70faa0f4b741c96f5fa088809c2aae5e
4
+ data.tar.gz: 49e761a209740b73c76089dd795ec34a8734359e4641348586a2b4b78c8db7a5
5
5
  SHA512:
6
- metadata.gz: d8ce0e64cda5d098eaa671521c7c8ea84f59215176d1f963a5ef9da9abbde7b32585de7f7f88f95fccba0b0f9a5ee697c455bcc9f2a6aecaaed943106d681e07
7
- data.tar.gz: 2fb5eb142b6d7289387a5ed5173d44a302ec105946918847c5f4142f80edc8f03508ae9ae24b1d9035adc79a98ecbaff4e0864702be53de4f28f6cf32a322c33
6
+ metadata.gz: 061a64fd057e3d704f3cf8555adbf96ca58270b41893852eb23bc5e138ca9f91acb575dc426d98f3dd047548b1b7fdf283808c6e51114243c7fb2fb50328aac7
7
+ data.tar.gz: 1f8ed1a5a8200ae44b95c515e4e4ba2b9c4a0f111e41c1454ee864002728fa328befbf5b64def806acef781674ec2413cbae6b88942b526e945903d5a789f8c8
@@ -14,7 +14,7 @@ module Fluent
14
14
  config_param :host, :string, :default => nil
15
15
  config_param :port, :integer, :default => 12201
16
16
  config_param :protocol, :string, :default => 'udp'
17
- config_param :udp_transport_type, :string, :default => 'WAN'
17
+ config_param :udp_transport_type, :string, :default => 'LAN'
18
18
  config_param :tls, :bool, :default => false
19
19
  config_param :tls_options, :hash, :default => {}
20
20
 
@@ -46,11 +46,20 @@ module Fluent
46
46
  # a destination hostname or IP address must be provided
47
47
  raise Fluent::ConfigError.new("'host' parameter (hostname or address of Graylog2 server) is required") unless conf.has_key?('host')
48
48
 
49
+ # validate udp_transport_type if protocol is udp
50
+ if @protocol == 'udp'
51
+ unless %w[WAN LAN].include?(@udp_transport_type)
52
+ raise Fluent::ConfigError.new("'udp_transport_type' parameter should be either 'WAN' or 'LAN'")
53
+ end
54
+ end
55
+
49
56
  # choose protocol to pass to gelf-rb Notifier constructor
50
- # (@protocol is used instead of conf['protocol'] to leverage config_param default)
51
- if @protocol == 'udp' then @proto = GELF::Protocol::UDP
52
- elsif @protocol == 'tcp' then @proto = GELF::Protocol::TCP
53
- else raise Fluent::ConfigError.new("'protocol' parameter should be either 'udp' (default) or 'tcp'")
57
+ if @protocol == 'udp'
58
+ @proto = GELF::Protocol::UDP
59
+ elsif @protocol == 'tcp'
60
+ @proto = GELF::Protocol::TCP
61
+ else
62
+ raise Fluent::ConfigError.new("'protocol' parameter should be either 'udp' (default) or 'tcp'")
54
63
  end
55
64
  end
56
65
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-gelf-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Yamauchi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-03-19 00:00:00.000000000 Z
13
+ date: 2025-03-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd