Interesting question! I would do that using ruby.
First, create a JSON dictionary that contains the mapping of field names. For example:
{
"1": "TradeName",
"2": "Foo",
"3": "bar"
}
Then use a ruby filter to do the lookups
ruby {
init => '@d = JSON.parse( File.read( "/path/to/dictionary.json" ) )'
code => '
event.to_hash.each { |k, v|
if @d.has_key?(k)
event.set(@d[k], v)
event.remove(k)
end
}
'
}
Error handling is left as an exercise for the reader.