lib/fluent/plugin/out_split.rb in fluent-plugin-split-0.0.1 vs lib/fluent/plugin/out_split.rb in fluent-plugin-split-0.0.2
- old
+ new
@@ -18,17 +18,18 @@
if @format == "csv"
@separator = ','
elsif @format == "tsv"
@separator = '\t'
elsif @format == "space"
- @separator = ' '
+ @separator = /[\s ]/
else
@separator = @format
end
end
def emit(tag, es, chain)
es.each { |time, record|
+ next if record[@key_name].nil?
record[@key_name].split(@separator).each{|item|
result = {@output_key => item}
record.each {|key,value|
result[key] = value if @keep_keys_array.include?(key)
}