Hi there,
I have a question about the ruby filter.
I am getting logs in Json they are working quite good, but ofcourse I have inconsistence in the mapping. Usually the logs arrive with the fields
arg0, arg1, arg,2
They are objects most of the times. But sometimes they are not objects so I have created a small ruby script to change the field names if they are not objects:
ruby {
code => "
fields = ['arg0', 'arg1', 'arg2', 'arg3', 'arg4', 'arg5']
fields.each do |field|
if event.get(field) and event.get(field).class != Hash
event.set(field, {'original_value' => event.get(field)})
end
end
"
}
This works quite well, but I have seen that this does not include booleans.
So when "arg0": false, "arg1": true
this ruby script does not work and the documents won´t be indexed because of a concrete value. I did not find a boolean class. Can anybody suggest something else I can do, except telling the developer to log properly
Greetings
Malte