33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/fluent/plugin/filter_record_modifier.rb', line 33
def configure(conf)
super
if conf.has_key?('include_tag_key')
raise ConfigError, "include_tag_key and tag_key parameters are removed. Use 'tag ${tag}' in <record> section"
end
@map = {}
conf.each_pair { |k, v|
unless BUILTIN_CONFIGURATIONS.include?(k)
conf.has_key?(k)
$log.warn "top level definition is deprecated. Please put parameters inside <record>: '#{k} #{v}'"
@map[k] = DynamicExpander.new(k, v)
end
}
if @char_encoding
from, to = @char_encoding.split(':', 2)
@from_enc = Encoding.find(from)
@to_enc = Encoding.find(to) if to
m = if @to_enc
method(:convert_encoding)
else
method(:set_encoding)
end
(class << self; self; end).module_eval do
define_method(:change_encoding, m)
end
end
@has_tag_parts = false
conf.elements.select { |element| element.name == 'record' }.each do |element|
element.each_pair do |k, v|
element.has_key?(k) @has_tag_parts = true if v.include?('tag_parts')
@map[k] = DynamicExpander.new(k, v)
end
end
if @remove_keys and @whitelist_keys
raise Fluent::ConfigError, "remove_keys and whitelist_keys are exclusive with each other."
elsif @remove_keys
@remove_keys = @remove_keys.split(',').map(&:strip)
elsif @whitelist_keys
@whitelist_keys = @whitelist_keys.split(',').map(&:strip)
end
GC.start
end
|