I have been using this external ruby code to add data to the documents, when a document has a planet_name equal to the key in the hash add the value to a field in the document
def register(params)
end
def filter(event)
planets= {
"jupiter" => "brown",
"mars" => "red",
};
event.set('planets_char', planets[event.get('planet_name')])
return [event]
end
I was wondering If I could add more than one value and set it in a diferent field for each value. something like this:
planets= {
"jupiter" => ["brown", "big" , "colder"]
"mars" => ["red", "small", "cold"]
};
But I dont know how I can set different values to different fields.
whill this work? how can I set different values to different fields?
Thanks!