28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/logstash/filters/list2fields.rb', line 28
def filter(event)
input = event[@source]
if !input.nil? && (input.is_a? Enumerable)
input.each do |entry|
begin
if entry.is_a?(::Hash)
new_key = @prefix.to_s + entry[@key].to_s
event[new_key] = entry[@value]
else
new_key = @prefix.to_s + entry.instance_variable_get("@" + @key)
event[new_key] = entry.instance_variable_get("@" + @value)
end rescue
@logger.debug("Could not find key " + @key + " in incoming data, please check your config. ")
end
end end end
|