Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wiredrat committed Sep 10, 2019
1 parent d5b0ab4 commit 250ec1d
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/logstash/codecs/leef.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def store_header_field(event,field_name,field_data)
def decode(data, &block)
if @delimiter
@buffer.extract(data).each do |line|
next if /^\s*$/.match(line) # Skip empty lines
handle(line, &block)
end
else
Expand All @@ -128,7 +127,7 @@ def decode(data, &block)

public
def handle(data, &block)
raise "Empty line" if /^\s*$/.match/data
raise "Empty line" if /^\s*$/.match(data)

event = LogStash::Event.new
event.set(raw_data_field, data) unless @raw_data_field.nil?
Expand Down Expand Up @@ -359,19 +358,4 @@ def get_value(fieldname, event)
end
end

#def sanitize_severity(event, severity)
# severity = sanitize_header_field(event.sprintf(severity)).strip
# severity = self.class.get_config["severity"][:default] unless valid_severity?(severity)
# severity = severity.to_i.to_s
#end

#def valid_severity?(sev)
# f = Float(sev)
# check if it's an integer or a float with no remainder
# and if the value is between 0 and 10 (inclusive)
# (f % 1 == 0) && f.between?(0,10)
#rescue TypeError, ArgumentError
# false
#end

end

0 comments on commit 250ec1d

Please sign in to comment.