Skip to content

Commit 399a19c

Browse files
authored
Merge pull request #3 from griff/master
Switch to forked gelfd2 gem for uncompressed support
2 parents 3cdb0a0 + cca66b3 commit 399a19c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

fluent-plugin-input-gelf.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
1717
gem.require_paths = ['lib']
1818

1919
gem.add_runtime_dependency "fluentd"
20-
gem.add_runtime_dependency "gelfd", ">= 0.2.0"
20+
gem.add_runtime_dependency "gelfd2", ">= 0.3.0"
2121

2222
gem.add_development_dependency "bundler"
2323
gem.add_development_dependency "rake"

lib/fluent/plugin/in_gelf.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GelfInput < Fluent::Input
1313
def initialize
1414
super
1515
require 'fluent/plugin/socket_util'
16-
require 'gelfd'
16+
require 'gelfd2'
1717
end
1818

1919
desc "The value is the tag assigned to the generated events."
@@ -70,7 +70,7 @@ def run
7070

7171
def receive_data(data, addr)
7272
begin
73-
msg = Gelfd::Parser.parse(data)
73+
msg = Gelfd2::Parser.parse(data)
7474
rescue => e
7575
log.warn 'Gelfd failed to parse a message', error: e.to_s
7676
log.warn_backtrace
@@ -89,7 +89,7 @@ def receive_data(data, addr)
8989
time = record.delete('timestamp').to_i if record.key?('timestamp')
9090

9191
# Postprocess recorded event
92-
strip_leading_underscore(record) if @strip_leading_underscore
92+
strip_leading_underscore_(record) if @strip_leading_underscore
9393

9494
emit(time, record)
9595
}
@@ -117,7 +117,7 @@ def emit(time, record)
117117

118118
private
119119

120-
def strip_leading_underscore(record)
120+
def strip_leading_underscore_(record)
121121
record.keys.each { |k|
122122
next unless k[0,1] == '_'
123123
record[k[1..-1]] = record.delete(k)

0 commit comments

Comments
 (0)